Merge lp:~attente/gtk/mir-fix-menubar-mouseover into lp:~ubuntu-desktop/gtk/ubuntugtk3

Proposed by William Hua
Status: Merged
Merged at revision: 398
Proposed branch: lp:~attente/gtk/mir-fix-menubar-mouseover
Merge into: lp:~ubuntu-desktop/gtk/ubuntugtk3
Diff against target: 577 lines (+241/-122)
1 file modified
debian/patches/mir-backend-unmerged.patch (+241/-122)
To merge this branch: bzr merge lp:~attente/gtk/mir-fix-menubar-mouseover
Reviewer Review Type Date Requested Status
Iain Lane Approve
Review via email: mp+245874@code.launchpad.net

Commit message

Add fix for menu bar issues in mir backend.

Description of the change

Add fix for menu bar issues in mir backend.

To post a comment you must log in.
396. By William Hua

Forgot to remove fuzz...

Revision history for this message
Iain Lane (laney) wrote :

Thanks, will be in the next upload

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/patches/mir-backend-unmerged.patch'
2--- debian/patches/mir-backend-unmerged.patch 2014-12-13 15:50:03 +0000
3+++ debian/patches/mir-backend-unmerged.patch 2015-01-12 15:19:21 +0000
4@@ -1,45 +1,49 @@
5-From 447c406a112e5dd6cc3b49f17bfa779d24e2ef3a Mon Sep 17 00:00:00 2001
6+From e1eec3144dea6f4f56d3a44a70fd0445a8baf626 Mon Sep 17 00:00:00 2001
7 From: William Hua <william@attente.ca>
8 Date: Fri, 28 Nov 2014 08:33:03 -0500
9-Subject: [PATCH 2/2] mir: unmerged commits from wip/mir2 branch
10+Subject: [PATCH] mir: unmerged commits from wip/mir2 branch
11
12 Backported from:
13-ce596da0d8eee33016bae8bda3d621860b45bccb
14-af8cf6945cea6b4257b7ca8b589efc69a8f48129
15-d8fc26da795d2b1730291879eac961441764c80a
16-13eb820d7f37a7a4b7e9eb00dd897acfbe116c3c
17-73002dca915da3834c6ccf4af422f9fb443637de
18-c9c85e1d9f87120c2f43764c78263d216fe04585
19-6db489dc399bfb1fb0fc206d0bd206ac3468c3c7
20-731b01de1f18354be1da21eeaf6ed8066b622a74
21-92dd2b7cb0a53f9d4480472d1a3756bcfae778c8
22-292229fa415133cc6801121eedc460caee287618
23-d2a0e3d013d5521f790aaf81cf68ff531adc7e3d
24-7d3257af05e364a7efa250a692e8e0dd2af6280a
25-f060bfbc338d109cc12f143761bf9d8d235171e7
26-310faf6c914967c58fa944577cd2238658e9f22a
27-62f25bef0f30350faf152b0d885ce01ad341ea70
28-52504167c1aeda2b76c24ad701d44a79968f715c
29-ada2ed8eca7f3e116a0e171dcbf6c13eda28c9c4
30-cc0f748f4d883103b50cfa09acda5c239f1a80d1
31-84119c20f297e4d02f4667a3d4d921e785fd77e9
32-d4d6d519bc88c79bfca6902f8f9f17a2392ae4ba
33-b9890b3d9ee8a8d3cbb31db6d4446910987f63ec
34+17197a742a3be693e2a354c537f4d19318e21da8
35+473d34d756f831f83febf674bbab02a301bddd43
36+ae3b2f249b99dd755bfc13878bf05af87f6382af
37+a8700fb23d93052322d97c93ddde8975d030434e
38+6cd3b430f7ddafdfb92fff339272bcd307648179
39+ffb39c8f552053ba63273925b38402197ee2d52d
40+8d57822a20ccb4fe2b26e11e09d6e25e6243ae1d
41+92e8bd0f5e1dc725fb558c64d5c45231e1fdb96f
42+6249b8c3cab68ad583a1301d2f7d22f0ffd555b7
43+b2904faa8c6aa36dce7a91cac901ad3dd770ba36
44+34ba7d03b4340bfc16697454d528377ef015a4aa
45+b6d0a2149a1f0318b96d8d0a1f7ed723630cdea4
46+3c7855ec87dd288b921d5b3359e23efce5355644
47+d588ae47d57c2ceaaa5e3bf7a3273a15118d4669
48+25a6590b5dfb91bca2723f081bd82ac7d29c19b1
49+132ab62504e5d091647abf3a94da3fbd183fa961
50+2b62118dfd5a575776fe4dc59f962e46f5f0ef47
51+34834b3d0d43ed4ce3dc2cb1523f076a93cea2ee
52+c9d4f3a2e1c2747235938a0baf189d480ebebb52
53+9f45287b5a50db306789af58c213731f6d193f4f
54+cf2879d781afbecbc3a004c7d62ff55bdd9270ab
55+bfb672ff3b9c8a48b1ad371e4081ca34e0ede674
56+d45cc36059246f1693f346290bd20623d03327c1
57+e13fc72af1f7ccad4f1fd7a3f4d077972627ad31
58+e5a1f9a1d326c2e3dd33153d7df5ea13b4eb06bf
59 ---
60- gdk/mir/gdkmir-private.h | 9 ++++
61- gdk/mir/gdkmirdisplay.c | 17 +++++--
62- gdk/mir/gdkmireventsource.c | 109 ++++++++++++++++++++++++++++++--------------
63- gdk/mir/gdkmirkeymap.c | 14 ++++++
64- gdk/mir/gdkmirpointer.c | 6 +++
65- gdk/mir/gdkmirscreen.c | 22 ++++-----
66- gdk/mir/gdkmirwindowimpl.c | 86 ++++++++++++++++++++++++++--------
67- 7 files changed, 195 insertions(+), 68 deletions(-)
68+ gdk/mir/gdkmir-private.h | 14 +++
69+ gdk/mir/gdkmirdisplay.c | 17 +++-
70+ gdk/mir/gdkmireventsource.c | 221 ++++++++++++++++++++++++++++++++------------
71+ gdk/mir/gdkmirkeymap.c | 14 +++
72+ gdk/mir/gdkmirpointer.c | 6 ++
73+ gdk/mir/gdkmirscreen.c | 22 ++---
74+ gdk/mir/gdkmirwindowimpl.c | 95 +++++++++++++++----
75+ 7 files changed, 295 insertions(+), 94 deletions(-)
76
77 diff --git a/gdk/mir/gdkmir-private.h b/gdk/mir/gdkmir-private.h
78-index 8305096..a5802f7 100644
79+index 053615a..6f0b6c3 100644
80 --- a/gdk/mir/gdkmir-private.h
81 +++ b/gdk/mir/gdkmir-private.h
82-@@ -45,6 +45,8 @@ GdkDevice *_gdk_mir_device_manager_get_keyboard (GdkDeviceManager *device_manage
83+@@ -69,6 +69,8 @@ GdkDevice *_gdk_mir_device_manager_get_keyboard (GdkDeviceManager *device_manage
84
85 GdkKeymap *_gdk_mir_keymap_new (void);
86
87@@ -48,23 +52,28 @@
88 GdkDevice *_gdk_mir_keyboard_new (GdkDeviceManager *device_manager, const gchar *name);
89
90 GdkDevice *_gdk_mir_pointer_new (GdkDeviceManager *device_manager, const gchar *name);
91-@@ -89,4 +91,11 @@ void _gdk_mir_print_resize_event (const MirResizeEvent *event);
92+@@ -131,4 +133,16 @@ void _gdk_mir_print_resize_event (const MirResizeEvent *event);
93
94 void _gdk_mir_print_event (const MirEvent *event);
95
96 +/* TODO: Remove once we have proper transient window support. */
97 +GdkWindow * _gdk_mir_window_get_visible_transient_child (GdkWindow *window,
98-+ gint x,
99-+ gint y,
100-+ gint *out_x,
101-+ gint *out_y);
102++ gdouble x,
103++ gdouble y,
104++ gdouble *out_x,
105++ gdouble *out_y);
106++
107++/* TODO: Remove once we have proper transient window support. */
108++void _gdk_mir_window_transient_children_foreach (GdkWindow *window,
109++ void (*func) (GdkWindow *, gpointer),
110++ gpointer user_data);
111 +
112 #endif /* __GDK_PRIVATE_MIR_H__ */
113 diff --git a/gdk/mir/gdkmirdisplay.c b/gdk/mir/gdkmirdisplay.c
114-index 207342c..13793ec 100644
115+index 5c27b53..cc92a53 100644
116 --- a/gdk/mir/gdkmirdisplay.c
117 +++ b/gdk/mir/gdkmirdisplay.c
118-@@ -391,9 +391,20 @@ gdk_mir_display_create_window_impl (GdkDisplay *display,
119+@@ -416,9 +416,20 @@ gdk_mir_display_create_window_impl (GdkDisplay *display,
120 g_printerr (" location=(%d, %d)", window->x, window->y);
121 g_printerr (" size=(%d, %d)", window->width, window->height);
122 g_printerr ("\n");
123@@ -89,7 +98,7 @@
124
125 static GdkKeymap *
126 diff --git a/gdk/mir/gdkmireventsource.c b/gdk/mir/gdkmireventsource.c
127-index cfe36e8..18364b0 100644
128+index cfe36e8..9843e2a 100644
129 --- a/gdk/mir/gdkmireventsource.c
130 +++ b/gdk/mir/gdkmireventsource.c
131 @@ -22,6 +22,8 @@
132@@ -259,7 +268,55 @@
133 break;
134 default:
135 //case mir_key_action_multiple:
136-@@ -284,6 +300,7 @@ handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
137+@@ -276,6 +292,47 @@ handle_key_event (GdkWindow *window, const MirKeyEvent *event)
138+ }
139+ }
140+
141++/* TODO: Remove once we have proper transient window support. */
142++typedef struct
143++{
144++ GdkWindow *except;
145++ gdouble x;
146++ gdouble y;
147++ guint32 time;
148++} LeaveInfo;
149++
150++/* TODO: Remove once we have proper transient window support. */
151++/*
152++ * leave_windows_except:
153++ *
154++ * Generate a leave event for every window except the one the cursor is in.
155++ */
156++static void
157++leave_windows_except (GdkWindow *window,
158++ gpointer user_data)
159++{
160++ LeaveInfo info = *((LeaveInfo *) user_data);
161++
162++ info.x -= window->x;
163++ info.y -= window->y;
164++
165++ _gdk_mir_window_transient_children_foreach (window, leave_windows_except, &info);
166++
167++ if (window != info.except)
168++ {
169++ GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
170++ gboolean cursor_inside;
171++ MirMotionButton button_state;
172++
173++ _gdk_mir_window_impl_get_cursor_state (impl, NULL, NULL, &cursor_inside, &button_state);
174++
175++ if (cursor_inside)
176++ generate_crossing_event (window, GDK_LEAVE_NOTIFY, info.x, info.y, info.time);
177++
178++ _gdk_mir_window_impl_set_cursor_state (impl, info.x, info.y, FALSE, button_state);
179++ }
180++}
181++
182+ static void
183+ handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
184+ {
185+@@ -284,6 +341,7 @@ handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
186 gboolean cursor_inside;
187 MirMotionButton button_state;
188 guint modifier_state;
189@@ -267,53 +324,128 @@
190 GdkEventType event_type;
191 MirMotionButton changed_button_state;
192
193-@@ -294,13 +311,14 @@ handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
194+@@ -294,45 +352,87 @@ handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
195 y = event->pointer_coordinates[0].y;
196 }
197 modifier_state = get_modifier_state (event->modifiers, event->button_state);
198 + event_time = NANO_TO_MILLI (event->event_time);
199
200- /* The Mir events generate hover-exits even while inside the window so
201- counteract this by always generating an enter notify on all other events */
202- if (!cursor_inside && event->action != mir_motion_action_hover_exit)
203+- /* The Mir events generate hover-exits even while inside the window so
204+- counteract this by always generating an enter notify on all other events */
205+- if (!cursor_inside && event->action != mir_motion_action_hover_exit)
206++ /* TODO: Remove once we have proper transient window support. */
207++ if (event->action == mir_motion_action_hover_exit)
208 {
209- cursor_inside = TRUE;
210+- cursor_inside = TRUE;
211 - generate_crossing_event (window, GDK_ENTER_NOTIFY, x, y);
212-+ generate_crossing_event (window, GDK_ENTER_NOTIFY, x, y, event_time);
213- }
214+- }
215++ LeaveInfo info;
216
217- /* Update which window has focus */
218-@@ -312,23 +330,23 @@ handle_motion_event (GdkWindow *window, const MirMotionEvent *event)
219- event_type = event->action == mir_motion_action_down ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE;
220- changed_button_state = button_state ^ event->button_state;
221- if (changed_button_state == 0 || (changed_button_state & mir_motion_button_primary) != 0)
222+- /* Update which window has focus */
223+- _gdk_mir_pointer_set_location (get_pointer (window), x, y, window, modifier_state);
224+- switch (event->action)
225++ info.x = x;
226++ info.y = y;
227++ info.time = event_time;
228++ info.except = window;
229++
230++ /* Leave all transient children from leaf to root, except the root since we do it later. */
231++ _gdk_mir_window_transient_children_foreach (window, leave_windows_except, &info);
232++ }
233++ else
234+ {
235+- case mir_motion_action_down:
236+- case mir_motion_action_up:
237+- event_type = event->action == mir_motion_action_down ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE;
238+- changed_button_state = button_state ^ event->button_state;
239+- if (changed_button_state == 0 || (changed_button_state & mir_motion_button_primary) != 0)
240 - generate_button_event (window, event_type, x, y, GDK_BUTTON_PRIMARY, modifier_state);
241-+ generate_button_event (window, event_type, x, y, GDK_BUTTON_PRIMARY, modifier_state, event_time);
242- if ((changed_button_state & mir_motion_button_secondary) != 0)
243+- if ((changed_button_state & mir_motion_button_secondary) != 0)
244 - generate_button_event (window, event_type, x, y, GDK_BUTTON_SECONDARY, modifier_state);
245-+ generate_button_event (window, event_type, x, y, GDK_BUTTON_SECONDARY, modifier_state, event_time);
246- if ((changed_button_state & mir_motion_button_tertiary) != 0)
247+- if ((changed_button_state & mir_motion_button_tertiary) != 0)
248 - generate_button_event (window, event_type, x, y, GDK_BUTTON_MIDDLE, modifier_state);
249-+ generate_button_event (window, event_type, x, y, GDK_BUTTON_MIDDLE, modifier_state, event_time);
250- button_state = event->button_state;
251- break;
252- case mir_motion_action_scroll:
253+- button_state = event->button_state;
254+- break;
255+- case mir_motion_action_scroll:
256 - generate_scroll_event (window, x, y, event->pointer_coordinates[0].hscroll, event->pointer_coordinates[0].vscroll, modifier_state);
257-+ generate_scroll_event (window, x, y, event->pointer_coordinates[0].hscroll, event->pointer_coordinates[0].vscroll, modifier_state, event_time);
258- break;
259- case mir_motion_action_move: // move with button
260- case mir_motion_action_hover_move: // move without button
261+- break;
262+- case mir_motion_action_move: // move with button
263+- case mir_motion_action_hover_move: // move without button
264 - generate_motion_event (window, x, y, modifier_state);
265-+ generate_motion_event (window, x, y, modifier_state, event_time);
266- break;
267- case mir_motion_action_hover_exit:
268- cursor_inside = FALSE;
269+- break;
270+- case mir_motion_action_hover_exit:
271+- cursor_inside = FALSE;
272 - generate_crossing_event (window, GDK_LEAVE_NOTIFY, x, y);
273-+ generate_crossing_event (window, GDK_LEAVE_NOTIFY, x, y, event_time);
274- break;
275+- break;
276++ LeaveInfo info;
277++
278++ info.x = x;
279++ info.y = y;
280++ info.time = event_time;
281++ info.except = _gdk_mir_window_get_visible_transient_child (window, x, y, &x, &y);
282++
283++ /* Leave all transient children from leaf to root, except the pointer window since we enter it. */
284++ _gdk_mir_window_transient_children_foreach (window, leave_windows_except, &info);
285++
286++ window = info.except;
287++
288++ if (window)
289++ {
290++ /* Enter the pointer window. */
291++ gboolean cursor_inside_pointer_window;
292++
293++ impl = GDK_MIR_WINDOW_IMPL (window->impl);
294++ _gdk_mir_window_impl_get_cursor_state (impl, NULL, NULL, &cursor_inside_pointer_window, NULL);
295++
296++ if (!cursor_inside_pointer_window)
297++ {
298++ generate_crossing_event (window, GDK_ENTER_NOTIFY, x, y, event_time);
299++ _gdk_mir_window_impl_set_cursor_state (impl, x, y, TRUE, event->button_state);
300++ }
301++ }
302 }
303
304-@@ -396,9 +414,6 @@ gdk_mir_event_source_queue_event (GdkDisplay *display,
305+- _gdk_mir_window_impl_set_cursor_state (impl, x, y, cursor_inside, button_state);
306++ if (window)
307++ {
308++ /* Update which window has focus */
309++ _gdk_mir_pointer_set_location (get_pointer (window), x, y, window, modifier_state);
310++ switch (event->action)
311++ {
312++ case mir_motion_action_down:
313++ case mir_motion_action_up:
314++ event_type = event->action == mir_motion_action_down ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE;
315++ changed_button_state = button_state ^ event->button_state;
316++ if (changed_button_state == 0 || (changed_button_state & mir_motion_button_primary) != 0)
317++ generate_button_event (window, event_type, x, y, GDK_BUTTON_PRIMARY, modifier_state, event_time);
318++ if ((changed_button_state & mir_motion_button_secondary) != 0)
319++ generate_button_event (window, event_type, x, y, GDK_BUTTON_SECONDARY, modifier_state, event_time);
320++ if ((changed_button_state & mir_motion_button_tertiary) != 0)
321++ generate_button_event (window, event_type, x, y, GDK_BUTTON_MIDDLE, modifier_state, event_time);
322++ button_state = event->button_state;
323++ break;
324++ case mir_motion_action_scroll:
325++ generate_scroll_event (window, x, y, event->pointer_coordinates[0].hscroll, event->pointer_coordinates[0].vscroll, modifier_state, event_time);
326++ break;
327++ case mir_motion_action_move: // move with button
328++ case mir_motion_action_hover_move: // move without button
329++ generate_motion_event (window, x, y, modifier_state, event_time);
330++ break;
331++ case mir_motion_action_hover_exit:
332++ if (cursor_inside)
333++ {
334++ cursor_inside = FALSE;
335++ generate_crossing_event (window, GDK_LEAVE_NOTIFY, x, y, event_time);
336++ }
337++ break;
338++ }
339++
340++ _gdk_mir_window_impl_set_cursor_state (impl, x, y, cursor_inside, button_state);
341++ }
342+ }
343+
344+ static void
345+@@ -396,9 +496,6 @@ gdk_mir_event_source_queue_event (GdkDisplay *display,
346 GdkWindow *window,
347 const MirEvent *event)
348 {
349@@ -323,34 +455,12 @@
350 // FIXME: Only generate events if the window wanted them?
351 switch (event->type)
352 {
353-@@ -459,7 +474,34 @@ gdk_mir_event_source_convert_events (GdkMirEventSource *source)
354+@@ -459,7 +556,12 @@ gdk_mir_event_source_convert_events (GdkMirEventSource *source)
355 * event was being dispatched...
356 */
357 if (window != NULL)
358 - gdk_mir_event_source_queue_event (source->display, window, &event->event);
359 + {
360-+ /* TODO: Remove once we have proper transient window support. */
361-+ if (event->event.type == mir_event_type_motion)
362-+ {
363-+ GdkWindow *child;
364-+ gint x;
365-+ gint y;
366-+
367-+ x = event->event.motion.pointer_coordinates[0].x;
368-+ y = event->event.motion.pointer_coordinates[0].y;
369-+
370-+ child = _gdk_mir_window_get_visible_transient_child (window, x, y, &x, &y);
371-+
372-+ if (child && child != window)
373-+ {
374-+ window = child;
375-+
376-+ event->event.motion.pointer_count = MAX (event->event.motion.pointer_count, 1);
377-+ event->event.motion.pointer_coordinates[0].x = x;
378-+ event->event.motion.pointer_coordinates[0].y = y;
379-+ }
380-+ }
381-+
382 + if (source->log_events)
383 + _gdk_mir_print_event (&event->event);
384 +
385@@ -359,7 +469,7 @@
386 else
387 g_warning ("window was destroyed before event arrived...");
388
389-@@ -554,6 +596,7 @@ _gdk_mir_event_source_new (GdkDisplay *display)
390+@@ -554,6 +656,7 @@ _gdk_mir_event_source_new (GdkDisplay *display)
391 source = (GdkMirEventSource *) g_source;
392 g_mutex_init (&source->mir_event_lock);
393 source->display = display;
394@@ -473,14 +583,14 @@
395 }
396
397 diff --git a/gdk/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c
398-index 418724b..92521c9 100644
399+index 6431ed4..37f96dc 100644
400 --- a/gdk/mir/gdkmirwindowimpl.c
401 +++ b/gdk/mir/gdkmirwindowimpl.c
402-@@ -259,13 +259,22 @@ redraw_transient (GdkWindow *window)
403+@@ -288,13 +288,22 @@ redraw_transient (GdkWindow *window)
404 gdk_window_invalidate_rect (GDK_MIR_WINDOW_IMPL (window->impl)->transient_for, &r, FALSE);
405 }
406
407-+/* Remove once we have proper transient window support. */
408++/* TODO: Remove once we have proper transient window support. */
409 +static gboolean
410 +should_render_in_parent (GdkWindow *window)
411 +{
412@@ -500,7 +610,7 @@
413 {
414 redraw_transient (window);
415 return;
416-@@ -327,7 +336,7 @@ gdk_mir_window_impl_ref_cairo_surface (GdkWindow *window)
417+@@ -352,7 +361,7 @@ gdk_mir_window_impl_ref_cairo_surface (GdkWindow *window)
418 }
419
420 /* Transient windows get rendered into a buffer and copied onto their parent */
421@@ -509,7 +619,7 @@
422 {
423 cairo_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, window->width, window->height);
424 }
425-@@ -363,13 +372,13 @@ gdk_mir_window_impl_ref_cairo_surface (GdkWindow *window)
426+@@ -373,13 +382,13 @@ gdk_mir_window_impl_ref_cairo_surface (GdkWindow *window)
427 impl->cairo_surface = cairo_surface_reference (cairo_surface);
428
429 /* Draw background */
430@@ -529,7 +639,7 @@
431
432 return cairo_surface;
433 }
434-@@ -433,10 +442,11 @@ gdk_mir_window_impl_hide (GdkWindow *window)
435+@@ -446,10 +455,11 @@ gdk_mir_window_impl_hide (GdkWindow *window)
436 //g_printerr ("gdk_mir_window_impl_hide window=%p\n", window);
437 GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
438
439@@ -542,7 +652,7 @@
440 redraw_transient (window);
441 }
442
443-@@ -446,10 +456,11 @@ gdk_mir_window_impl_withdraw (GdkWindow *window)
444+@@ -459,10 +469,11 @@ gdk_mir_window_impl_withdraw (GdkWindow *window)
445 //g_printerr ("gdk_mir_window_impl_withdraw window=%p\n", window);
446 GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
447
448@@ -555,7 +665,7 @@
449 redraw_transient (window);
450 }
451
452-@@ -492,6 +503,7 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
453+@@ -505,6 +516,7 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
454 gint width,
455 gint height)
456 {
457@@ -563,7 +673,7 @@
458 g_printerr ("gdk_mir_window_impl_move_resize");
459 g_printerr (" window=%p", window);
460 if (with_move)
461-@@ -499,16 +511,17 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
462+@@ -512,16 +524,17 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
463 if (width > 0)
464 g_printerr (" size=%dx%dpx", width, height);
465 g_printerr ("\n");
466@@ -583,7 +693,7 @@
467 {
468 window->x = x;
469 window->y = y;
470-@@ -535,7 +548,7 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
471+@@ -548,7 +561,7 @@ gdk_mir_window_impl_move_resize (GdkWindow *window,
472 }
473
474 /* Redraw parent where we moved to */
475@@ -592,7 +702,7 @@
476 redraw_transient (window);
477 }
478
479-@@ -699,7 +712,7 @@ gdk_mir_window_impl_input_shape_combine_region (GdkWindow *window,
480+@@ -711,7 +724,7 @@ gdk_mir_window_impl_input_shape_combine_region (GdkWindow *window,
481 gint offset_x,
482 gint offset_y)
483 {
484@@ -601,7 +711,7 @@
485 }
486
487 static void
488-@@ -713,7 +726,7 @@ gdk_mir_window_impl_destroy (GdkWindow *window,
489+@@ -725,7 +738,7 @@ gdk_mir_window_impl_destroy (GdkWindow *window,
490 impl->visible = FALSE;
491 ensure_no_surface (window);
492
493@@ -610,7 +720,7 @@
494 {
495 /* Redraw parent */
496 redraw_transient (window);
497-@@ -850,7 +863,7 @@ static void
498+@@ -862,7 +875,7 @@ static void
499 gdk_mir_window_impl_set_title (GdkWindow *window,
500 const gchar *title)
501 {
502@@ -619,7 +729,7 @@
503 }
504
505 static void
506-@@ -881,7 +894,7 @@ gdk_mir_window_impl_set_transient_for (GdkWindow *window,
507+@@ -893,7 +906,7 @@ gdk_mir_window_impl_set_transient_for (GdkWindow *window,
508
509 /* Link this window to the parent */
510 impl->transient_for = parent;
511@@ -628,7 +738,7 @@
512 {
513 GdkMirWindowImpl *parent_impl = GDK_MIR_WINDOW_IMPL (parent->impl);
514 parent_impl->transient_children = g_list_append (parent_impl->transient_children, window);
515-@@ -895,7 +908,42 @@ gdk_mir_window_impl_set_transient_for (GdkWindow *window,
516+@@ -907,7 +920,51 @@ gdk_mir_window_impl_set_transient_for (GdkWindow *window,
517 }
518
519 /* Remove surface if we had made one before this was set */
520@@ -640,22 +750,21 @@
521 +/* TODO: Remove once we have proper transient window support. */
522 +GdkWindow *
523 +_gdk_mir_window_get_visible_transient_child (GdkWindow *window,
524-+ gint x,
525-+ gint y,
526-+ gint *out_x,
527-+ gint *out_y)
528++ gdouble x,
529++ gdouble y,
530++ gdouble *out_x,
531++ gdouble *out_y)
532 +{
533 + GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
534 + GdkWindow *child = NULL;
535 + GList *i;
536 +
537-+ if (x < window->x || x >= window->x + window->width ||
538-+ y < window->y || y >= window->y + window->height)
539-+ return NULL;
540-+
541 + x -= window->x;
542 + y -= window->y;
543 +
544++ if (x < 0 || x >= window->width || y < 0 || y >= window->height)
545++ return NULL;
546++
547 + for (i = impl->transient_children; i && !child; i = i->next)
548 + {
549 + if (GDK_MIR_WINDOW_IMPL (GDK_WINDOW (i->data)->impl)->visible)
550@@ -669,10 +778,20 @@
551 + *out_y = y;
552 +
553 + return window;
554++}
555++
556++/* TODO: Remove once we have proper transient window support. */
557++void
558++_gdk_mir_window_transient_children_foreach (GdkWindow *window,
559++ void (*func) (GdkWindow *, gpointer),
560++ gpointer user_data)
561++{
562++ GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
563++ g_list_foreach (impl->transient_children, (GFunc) func, user_data);
564 }
565
566 static void
567-@@ -1242,7 +1290,7 @@ gdk_mir_window_impl_set_shadow_width (GdkWindow *window,
568+@@ -1254,7 +1311,7 @@ gdk_mir_window_impl_set_shadow_width (GdkWindow *window,
569 gint top,
570 gint bottom)
571 {
572@@ -682,5 +801,5 @@
573
574 static void
575 --
576-2.1.3
577+2.1.4
578

Subscribers

People subscribed via source and target branches

to all changes: