wok-next view lxpanel/stuff/fix_position.patch @ rev 17676
rogue: add missing -ltinfo
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Feb 18 11:35:54 2015 +0100 (2015-02-18) |
parents | |
children |
line source
1 Index: lxpanel-0.5.8/src/plugins/menu.c
2 ===================================================================
3 --- lxpanel-0.5.8.orig/src/plugins/menu.c 2011-10-05 23:55:47.000000000 +0200
4 +++ lxpanel-0.5.8/src/plugins/menu.c 2011-10-05 23:55:49.000000000 +0200
5 @@ -131,8 +131,8 @@
6 int ox, oy, w, h;
7 Plugin *p;
8 #if GTK_CHECK_VERSION(2,18,0)
9 - GtkAllocation allocation;
10 - gtk_widget_set_allocation(widget, &allocation);
11 + GtkAllocation *allocation = g_new0 (GtkAllocation, 1);
12 + gtk_widget_get_allocation(GTK_WIDGET(widget), allocation);
13 #endif
14 ENTER;
15 p = g_object_get_data(G_OBJECT(widget), "plugin");
16 @@ -155,20 +155,20 @@
17 *x = ox;
18 if (*x + w > gdk_screen_width())
19 #if GTK_CHECK_VERSION(2,18,0)
20 - *x = ox + allocation.width - w;
21 + *x = ox + allocation->width - w;
22 #else
23 *x = ox + widget->allocation.width - w;
24 #endif
25 *y = oy - h;
26 if (*y < 0)
27 #if GTK_CHECK_VERSION(2,18,0)
28 - *y = oy + allocation.height;
29 + *y = oy + allocation->height;
30 #else
31 *y = oy + widget->allocation.height;
32 #endif
33 } else {
34 #if GTK_CHECK_VERSION(2,18,0)
35 - *x = ox + allocation.width;
36 + *x = ox + allocation->width;
37 #else
38 *x = ox + widget->allocation.width;
39 #endif
40 @@ -177,19 +177,22 @@
41 *y = oy;
42 if (*y + h > gdk_screen_height())
43 #if GTK_CHECK_VERSION(2,18,0)
44 - *y = oy + allocation.height - h;
45 + *y = oy + allocation->height - h;
46 #else
47 *y = oy + widget->allocation.height - h;
48 #endif
49 }
50 DBG("widget: x,y=%d,%d w,h=%d,%d\n", ox, oy,
51 #if GTK_CHECK_VERSION(2,18,0)
52 - allocation.width, allocation.height );
53 + allocation->width, allocation->height );
54 #else
55 widget->allocation.width, widget->allocation.height );
56 #endif
57 DBG("w-h %d %d\n", w, h);
58 *push_in = TRUE;
59 +#if GTK_CHECK_VERSION(2,18,0)
60 + g_free (allocation);
61 +#endif
62 RET();
63 }
65 @@ -634,8 +637,8 @@
66 {
67 ENTER;
68 #if GTK_CHECK_VERSION(2,18,0)
69 - GtkAllocation allocation;
70 - gtk_widget_get_allocation(widget, &allocation);
71 + GtkAllocation *allocation = g_new0 (GtkAllocation, 1);
72 + gtk_widget_get_allocation(GTK_WIDGET(widget), allocation);
73 #endif
75 /* Standard right-click handling. */
76 @@ -644,14 +647,17 @@
78 if ((event->type == GDK_BUTTON_PRESS)
79 #if GTK_CHECK_VERSION(2,18,0)
80 - && (event->x >=0 && event->x < allocation.width)
81 - && (event->y >=0 && event->y < allocation.height)) {
82 + && (event->x >=0 && event->x < allocation->width)
83 + && (event->y >=0 && event->y < allocation->height)) {
84 #else
85 && (event->x >=0 && event->x < widget->allocation.width)
86 && (event->y >=0 && event->y < widget->allocation.height)) {
87 #endif
88 show_menu( widget, plugin, event->button, event->time );
89 }
90 +#if GTK_CHECK_VERSION(2,18,0)
91 + g_free (allocation);
92 +#endif
93 RET(TRUE);
94 }
96 Index: lxpanel-0.5.8/src/plugins/pager.c
97 ===================================================================
98 --- lxpanel-0.5.8.orig/src/plugins/pager.c 2011-10-05 23:55:47.000000000 +0200
99 +++ lxpanel-0.5.8/src/plugins/pager.c 2011-10-05 23:56:29.000000000 +0200
100 @@ -271,10 +271,10 @@
101 {
102 /* Allocate pixmap and statistics buffer without border pixels. */
103 #if GTK_CHECK_VERSION(2,18,0)
104 - GtkAllocation allocation;
105 - gtk_widget_get_allocation(widget, &allocation);
106 - int new_pixmap_width = allocation.width;
107 - int new_pixmap_height = allocation.height;
108 + GtkAllocation *allocation = g_new0 (GtkAllocation, 1);
109 + gtk_widget_get_allocation(GTK_WIDGET(widget), allocation);
110 + int new_pixmap_width = allocation->width;
111 + int new_pixmap_height = allocation->height;
112 #else
113 int new_pixmap_width = widget->allocation.width;
114 int new_pixmap_height = widget->allocation.height;
115 @@ -292,8 +292,8 @@
117 /* Compute the horizontal and vertical scale factors, and mark the desktop for redraw. */
118 #if GTK_CHECK_VERSION(2,18,0)
119 - d->scale_y = (gfloat) allocation.height / (gfloat) gdk_screen_height();
120 - d->scale_x = (gfloat) allocation.width / (gfloat) gdk_screen_width();
121 + d->scale_y = (gfloat) allocation->height / (gfloat) gdk_screen_height();
122 + d->scale_x = (gfloat) allocation->width / (gfloat) gdk_screen_width();
123 #else
124 d->scale_y = (gfloat) allocation->height / (gfloat) gdk_screen_height();
125 d->scale_x = (gfloat) allocation->width / (gfloat) gdk_screen_width();
126 @@ -305,6 +305,9 @@
127 gtk_widget_set_size_request(widget,
128 (d->pg->plugin->panel->icon_size - BORDER_WIDTH * 2) * d->pg->aspect_ratio,
129 d->pg->plugin->panel->icon_size - BORDER_WIDTH * 2);
130 +#if GTK_CHECK_VERSION(2,18,0)
131 + g_free (allocation);
132 +#endif
133 return FALSE;
134 }
136 @@ -326,8 +329,8 @@
137 {
138 GtkWidget * widget = GTK_WIDGET(d->da);
139 #if GTK_CHECK_VERSION(2,18,0)
140 - GtkAllocation allocation;
141 - gtk_widget_get_allocation(widget, &allocation);
142 + GtkAllocation *allocation = g_new0 (GtkAllocation, 1);
143 + gtk_widget_get_allocation(GTK_WIDGET(widget), allocation);
144 #endif
145 gdk_draw_rectangle(
146 d->pixmap,
147 @@ -336,7 +339,8 @@
148 : style->dark_gc[GTK_STATE_NORMAL]),
149 TRUE,
150 #if GTK_CHECK_VERSION(2,18,0)
151 - 0, 0, allocation.width, allocation.height);
152 + 0, 0, allocation->width, allocation->height);
153 + g_free (allocation);
154 #else
155 0, 0, widget->allocation.width, widget->allocation.height);
156 #endif