aboutsummaryrefslogtreecommitdiffstats
path: root/meta/packages/gtk+/gtk+-2.10.0/gtk+-handhelds.patch
blob: 4b97373f325b8f529fe60573e4ee6bb0c4c53627 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
--- gtk+-2.8.6/gtk/gtkrange.c.orig	2005-12-07 21:13:33 +0100
+++ gtk+-2.8.6/gtk/gtkrange.c	2005-12-07 21:21:12 +0100
@@ -186,6 +186,7 @@
 static GtkWidgetClass *parent_class = NULL;
 static guint signals[LAST_SIGNAL];
 
+static GdkAtom recognize_protocols_atom, atom_atom;
 
 GType
 gtk_range_get_type (void)
@@ -226,6 +227,9 @@
   object_class = (GtkObjectClass*) class;
   widget_class = (GtkWidgetClass*) class;
 
+  recognize_protocols_atom = gdk_atom_intern ("RECOGNIZE_PROTOCOLS", FALSE);
+  atom_atom = gdk_atom_intern ("ATOM", FALSE);
+
   parent_class = g_type_class_peek_parent (class);
 
   gobject_class->set_property = gtk_range_set_property;
@@ -860,6 +864,12 @@
 					&attributes, attributes_mask);
   gdk_window_set_user_data (range->event_window, range);
 
+  gdk_property_change (range->event_window,
+		       recognize_protocols_atom,
+		       atom_atom,
+		       32, GDK_PROP_MODE_REPLACE,
+		       NULL, 0);
+
   widget->style = gtk_style_attach (widget->style, widget->window);
 }
 
@@ -1229,7 +1239,7 @@
 
   /* ignore presses when we're already doing something else. */
   if (range->layout->grab_location != MOUSE_OUTSIDE)
-    return FALSE;
+    return TRUE;
 
   range->layout->mouse_x = event->x;
   range->layout->mouse_y = event->y;
@@ -1429,7 +1439,7 @@
       return TRUE;
     }
 
-  return FALSE;
+  return TRUE;
 }
 
 /**
--- gtk+-2.8.6/gtk/gtkentry.c.orig	2005-09-02 21:51:06 +0200
+++ gtk+-2.8.6/gtk/gtkentry.c	2005-12-07 21:21:12 +0100
@@ -597,6 +597,15 @@
 						       0.0,
 						       GTK_PARAM_READWRITE));
   
+  gtk_widget_class_install_style_property (widget_class,
+					   g_param_spec_int ("min_width",
+                                                             _("Minimum width"),
+                                                             _("Minimum width of the entry field"),
+                                                             0,
+                                                             G_MAXINT,
+                                                             MIN_ENTRY_WIDTH,
+                                                             G_PARAM_READABLE));
+
   signals[POPULATE_POPUP] =
     g_signal_new ("populate_popup",
 		  G_OBJECT_CLASS_TYPE (gobject_class),
@@ -1227,7 +1236,7 @@
 {
   GtkEntry *entry = GTK_ENTRY (widget);
   PangoFontMetrics *metrics;
-  gint xborder, yborder;
+  gint xborder, yborder, min_width;
   PangoContext *context;
   
   gtk_widget_ensure_style (widget);
@@ -1243,9 +1252,11 @@
   
   xborder += INNER_BORDER;
   yborder += INNER_BORDER;
-  
+
+  gtk_widget_style_get (widget, "min_width", &min_width, NULL);
+
   if (entry->width_chars < 0)
-    requisition->width = MIN_ENTRY_WIDTH + xborder * 2;
+    requisition->width = min_width + xborder * 2;
   else
     {
       gint char_width = pango_font_metrics_get_approximate_char_width (metrics);
--- gtk+-2.8.6/gtk/gtkarrow.c.orig	2005-06-21 17:38:39 +0200
+++ gtk+-2.8.6/gtk/gtkarrow.c	2005-12-07 21:21:12 +0100
@@ -31,7 +31,7 @@
 #include "gtkintl.h"
 #include "gtkalias.h"
 
-#define MIN_ARROW_SIZE  15
+#define MIN_ARROW_SIZE  7
 
 enum {
   PROP_0,
@@ -55,6 +55,8 @@
 				    guint            prop_id,
 				    GValue          *value,
 				    GParamSpec      *pspec);
+static void gtk_arrow_size_request (GtkWidget *arrow, 
+				    GtkRequisition *requisition);
 
 GType
 gtk_arrow_get_type (void)
@@ -113,6 +115,7 @@
                                                       GTK_PARAM_READWRITE));
   
   widget_class->expose_event = gtk_arrow_expose;
+  widget_class->size_request = gtk_arrow_size_request;
 }
 
 static void
@@ -168,13 +171,18 @@
 }
 
 static void
+gtk_arrow_size_request (GtkWidget *arrow, 
+			GtkRequisition *requisition)
+{
+  requisition->width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2;
+  requisition->height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2;
+}
+
+static void
 gtk_arrow_init (GtkArrow *arrow)
 {
   GTK_WIDGET_SET_FLAGS (arrow, GTK_NO_WINDOW);
 
-  GTK_WIDGET (arrow)->requisition.width = MIN_ARROW_SIZE + GTK_MISC (arrow)->xpad * 2;
-  GTK_WIDGET (arrow)->requisition.height = MIN_ARROW_SIZE + GTK_MISC (arrow)->ypad * 2;
-
   arrow->arrow_type = GTK_ARROW_RIGHT;
   arrow->shadow_type = GTK_SHADOW_OUT;
 }
--- gtk+-2.8.6/gtk/gtkcalendar.c.orig	2005-12-07 21:36:14 +0100
+++ gtk+-2.8.6/gtk/gtkcalendar.c	2005-12-07 21:49:21 +0100
@@ -692,6 +692,35 @@
  ****************************************/
 
 static void
+calendar_select_day (GtkCalendar *calendar, guint day)
+{
+  g_return_if_fail (GTK_IS_CALENDAR (calendar));
+  g_return_if_fail (day <= 31);
+  
+  /* Deselect the old day */
+  if (calendar->selected_day > 0)
+    {
+      gint selected_day;
+      
+      selected_day = calendar->selected_day;
+      calendar->selected_day = 0;
+      if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
+	calendar_invalidate_day_num (calendar, selected_day);
+    }
+  
+  calendar->selected_day = day;
+  
+  /* Select the new day */
+  if (day != 0)
+    {
+      if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
+	calendar_invalidate_day_num (calendar, day);
+    }
+  
+  g_object_notify (G_OBJECT (calendar), "day");
+}
+
+static void
 calendar_set_month_next (GtkCalendar *calendar)
 {
   gint month_len;
@@ -723,10 +752,10 @@
   if (month_len < calendar->selected_day)
     {
       calendar->selected_day = 0;
-      gtk_calendar_select_day (calendar, month_len);
+      calendar_select_day (calendar, month_len);
     }
   else
-    gtk_calendar_select_day (calendar, calendar->selected_day);
+    calendar_select_day (calendar, calendar->selected_day);
 
   gtk_widget_queue_draw (GTK_WIDGET (calendar));
 }
@@ -752,10 +781,10 @@
   if (month_len < calendar->selected_day)
     {
       calendar->selected_day = 0;
-      gtk_calendar_select_day (calendar, month_len);
+      calendar_select_day (calendar, month_len);
     }
   else
-    gtk_calendar_select_day (calendar, calendar->selected_day);
+    calendar_select_day (calendar, calendar->selected_day);
   
   gtk_widget_queue_draw (GTK_WIDGET (calendar));
 }
@@ -784,10 +813,10 @@
   if (month_len < calendar->selected_day)
     {
       calendar->selected_day = 0;
-      gtk_calendar_select_day (calendar, month_len);
+      calendar_select_day (calendar, month_len);
     }
   else
-    gtk_calendar_select_day (calendar, calendar->selected_day);
+    calendar_select_day (calendar, calendar->selected_day);
   
   gtk_widget_queue_draw (GTK_WIDGET (calendar));
 }
@@ -1088,13 +1117,13 @@
   if (month_len < calendar->selected_day)
     {
       calendar->selected_day = 0;
-      gtk_calendar_select_day (calendar, month_len);
+      calendar_select_day (calendar, month_len);
     }
   else
     {
       if (calendar->selected_day < 0)
 	calendar->selected_day = calendar->selected_day + 1 + month_length[leap (calendar->year)][calendar->month + 1];
-      gtk_calendar_select_day (calendar, calendar->selected_day);
+      calendar_select_day (calendar, calendar->selected_day);
     }
 
   gtk_widget_queue_draw (GTK_WIDGET (calendar));
@@ -3285,27 +3314,7 @@
   g_return_if_fail (GTK_IS_CALENDAR (calendar));
   g_return_if_fail (day <= 31);
   
-  /* Deselect the old day */
-  if (calendar->selected_day > 0)
-    {
-      gint selected_day;
-      
-      selected_day = calendar->selected_day;
-      calendar->selected_day = 0;
-      if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
-	calendar_invalidate_day_num (calendar, selected_day);
-    }
-  
-  calendar->selected_day = day;
-  
-  /* Select the new day */
-  if (day != 0)
-    {
-      if (GTK_WIDGET_DRAWABLE (GTK_WIDGET (calendar)))
-	calendar_invalidate_day_num (calendar, day);
-    }
-  
-  g_object_notify (G_OBJECT (calendar), "day");
+  calendar_select_day (calendar, day);
 
   g_signal_emit (calendar,
 		 gtk_calendar_signals[DAY_SELECTED_SIGNAL],