Merge lp:~attente/gtk/refresh-mir-3 into lp:~ubuntu-desktop/gtk/ubuntugtk3

Proposed by William Hua on 2015-11-02
Status: Merged
Merged at revision: 471
Proposed branch: lp:~attente/gtk/refresh-mir-3
Merge into: lp:~ubuntu-desktop/gtk/ubuntugtk3
Diff against target: 339 lines (+304/-1)
4 files modified
debian/changelog (+5/-1)
debian/control (+1/-0)
debian/patches/git-refresh-mir-backend.patch (+297/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~attente/gtk/refresh-mir-3
Reviewer Review Type Date Requested Status
Iain Lane 2015-11-02 Approve on 2015-11-03
Review via email: mp+276420@code.launchpad.net

Commit message

Refresh Mir backend

Description of the change

Refresh Mir backend

To post a comment you must log in.
lp:~attente/gtk/refresh-mir-3 updated on 2015-11-02
472. By William Hua on 2015-11-02

Correct version in debian/changelog

Iain Lane (laney) wrote :

thanks!

review: Approve
Iain Lane (laney) wrote :

just noticed that this failed

  https://launchpadlibrarian.net/225349227/buildlog_ubuntu-xenial-amd64.gtk+3.0_3.18.2-1ubuntu1~ppa1_BUILDING.txt.gz

you need to update control.in as well as control (edit control.in and then run debian/rules clean) as the latter is generated and changes you only make to it are lost

Should have spotted this earlier!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-10-23 17:04:03 +0000
3+++ debian/changelog 2015-11-02 16:43:04 +0000
4@@ -29,7 +29,11 @@
5 * debian/patches/unity_rbga_tooltips.patch:
6 - GtkTooltip: set always an rgba visual when running in Unity (LP: #1508357)
7
8- -- Iain Lane <iain.lane@canonical.com> Sat, 17 Oct 2015 06:10:27 +0000
9+ [ William Hua ]
10+ * debian/patches/git-refresh-mir-backend.patch:
11+ - Refresh Mir backend
12+
13+ -- William Hua <william.hua@canonical.com> Mon, 02 Nov 2015 10:52:01 -0500
14
15 gtk+3.0 (3.18.2-1) unstable; urgency=medium
16
17
18=== modified file 'debian/control'
19--- debian/control 2015-10-23 16:17:58 +0000
20+++ debian/control 2015-11-02 16:43:04 +0000
21@@ -49,6 +49,7 @@
22 libgirepository1.0-dev (>= 1.39.0),
23 xvfb,
24 libmirclient-dev (>= 0.13.3),
25+ libmircookie-dev (>= 0.17.0),
26 Build-Depends-Indep: docbook-xml,
27 docbook-utils,
28 libglib2.0-doc,
29
30=== added file 'debian/patches/git-refresh-mir-backend.patch'
31--- debian/patches/git-refresh-mir-backend.patch 1970-01-01 00:00:00 +0000
32+++ debian/patches/git-refresh-mir-backend.patch 2015-11-02 16:43:04 +0000
33@@ -0,0 +1,297 @@
34+From 323c9d6b5a8d7ddb8a803bfde7897540504b1bed Mon Sep 17 00:00:00 2001
35+From: William Hua <william.hua@canonical.com>
36+Date: Tue, 13 Oct 2015 10:18:11 +0100
37+Subject: [PATCH] Refresh Mir backend
38+
39+---
40+ configure.ac | 3 ++-
41+ gdk/mir/gdkmir-debug.c | 61 ++++++++++++++++++++++++++++++++++++++++++++-
42+ gdk/mir/gdkmirdisplay.c | 23 ++++++++++-------
43+ gdk/mir/gdkmireventsource.c | 41 +++++++++++++++++++++++++++++-
44+ gdk/mir/gdkmirwindowimpl.c | 39 +++++++++++++++++++++++++++--
45+ 5 files changed, 153 insertions(+), 14 deletions(-)
46+
47+diff --git a/configure.ac b/configure.ac
48+index 10038e0..e35c751 100644
49+--- a/configure.ac
50++++ b/configure.ac
51+@@ -61,6 +61,7 @@ m4_define([gdk_pixbuf_required_version], [2.30.0])
52+ m4_define([introspection_required_version], [1.39.0])
53+ m4_define([wayland_required_version], [1.5.91])
54+ m4_define([mirclient_required_version], [0.11.0])
55++m4_define([mircookie_required_version], [0.17.0])
56+ m4_define([epoxy_required_version], [1.0])
57+ GLIB_REQUIRED_VERSION=glib_required_version
58+ PANGO_REQUIRED_VERSION=pango_required_version
59+@@ -457,7 +458,7 @@ else
60+ AM_CONDITIONAL(USE_WAYLAND, false)
61+ fi
62+
63+-MIR_DEPENDENCIES="mirclient >= mirclient_required_version"
64++MIR_DEPENDENCIES="mirclient >= mirclient_required_version mircookie >= mircookie_required_version"
65+ if test "$enable_mir_backend" = "maybe" ; then
66+ PKG_CHECK_EXISTS($MIR_DEPENDENCIES, [have_mir_deps=yes], [have_mir_deps=no])
67+ AC_MSG_CHECKING([for MIR_DEPENDENCIES])
68+diff --git a/gdk/mir/gdkmir-debug.c b/gdk/mir/gdkmir-debug.c
69+index a135f1b..8355167 100644
70+--- a/gdk/mir/gdkmir-debug.c
71++++ b/gdk/mir/gdkmir-debug.c
72+@@ -91,6 +91,62 @@ _gdk_mir_print_key_event (const MirInputEvent *event)
73+ g_printerr (" Event Time %lli\n", (long long int) mir_input_event_get_event_time (event));
74+ }
75+
76++static void
77++_gdk_mir_print_touch_event (const MirInputEvent *event)
78++{
79++ const MirTouchEvent *touch_event = mir_input_event_get_touch_event (event);
80++ guint i;
81++ guint n;
82++
83++ if (!touch_event)
84++ return;
85++
86++ g_printerr ("TOUCH\n");
87++ g_printerr (" Device %lld\n", (long long int) mir_input_event_get_device_id (event));
88++ g_printerr (" Event Time %lld\n", (long long int) mir_input_event_get_event_time (event));
89++ _gdk_mir_print_modifiers (mir_touch_event_modifiers (touch_event));
90++ n = mir_touch_event_point_count (touch_event);
91++
92++ for (i = 0; i < n; i++)
93++ {
94++ g_printerr (" [%u] (%u/%u) ", mir_touch_event_id (touch_event, i), i + 1, n);
95++ switch (mir_touch_event_action (touch_event, i))
96++ {
97++ case mir_touch_action_down:
98++ g_printerr ("Down");
99++ break;
100++ case mir_touch_action_up:
101++ g_printerr ("Up");
102++ break;
103++ case mir_touch_action_change:
104++ g_printerr ("Change");
105++ break;
106++ default:
107++ g_printerr ("%u", mir_touch_event_action (touch_event, i));
108++ break;
109++ }
110++ switch (mir_touch_event_tooltype (touch_event, i))
111++ {
112++ case mir_touch_tooltype_unknown:
113++ g_printerr (" ? ");
114++ break;
115++ case mir_touch_tooltype_finger:
116++ g_printerr (" finger ");
117++ break;
118++ case mir_touch_tooltype_stylus:
119++ g_printerr (" stylus ");
120++ break;
121++ }
122++ g_printerr ("\n x: %f y: %f P: %f A: %f B: %f d: %f\n",
123++ mir_touch_event_axis_value (touch_event, i, mir_touch_axis_x),
124++ mir_touch_event_axis_value (touch_event, i, mir_touch_axis_y),
125++ mir_touch_event_axis_value (touch_event, i, mir_touch_axis_pressure),
126++ mir_touch_event_axis_value (touch_event, i, mir_touch_axis_touch_major),
127++ mir_touch_event_axis_value (touch_event, i, mir_touch_axis_touch_minor),
128++ mir_touch_event_axis_value (touch_event, i, mir_touch_axis_size));
129++ }
130++}
131++
132+ void
133+ _gdk_mir_print_motion_event (const MirInputEvent *event)
134+ {
135+@@ -138,6 +194,8 @@ _gdk_mir_print_motion_event (const MirInputEvent *event)
136+ g_printerr ("\n");
137+ g_printerr (" Offset (%f, %f)\n", mir_pointer_event_axis_value (pointer_event, mir_pointer_axis_x),
138+ mir_pointer_event_axis_value (pointer_event, mir_pointer_axis_y));
139++ g_printerr (" Scroll (%f, %f)\n", mir_pointer_event_axis_value (pointer_event, mir_pointer_axis_hscroll),
140++ mir_pointer_event_axis_value (pointer_event, mir_pointer_axis_vscroll));
141+ g_printerr (" Event Time %lli\n", (long long int) mir_input_event_get_event_time (event));
142+ }
143+
144+@@ -197,7 +255,7 @@ _gdk_mir_print_event (const MirEvent *event)
145+ _gdk_mir_print_key_event (mir_event_get_input_event (event));
146+ break;
147+ case mir_input_event_type_touch:
148+- _gdk_mir_print_motion_event (mir_event_get_input_event (event));
149++ _gdk_mir_print_touch_event (mir_event_get_input_event (event));
150+ break;
151+ case mir_input_event_type_pointer:
152+ _gdk_mir_print_motion_event (mir_event_get_input_event (event));
153+diff --git a/gdk/mir/gdkmirdisplay.c b/gdk/mir/gdkmirdisplay.c
154+index 6eda352..73f8bcf 100644
155+--- a/gdk/mir/gdkmirdisplay.c
156++++ b/gdk/mir/gdkmirdisplay.c
157+@@ -539,12 +539,19 @@ get_pixel_formats (MirConnection *connection,
158+ {
159+ *sw_pixel_format = mir_pixel_format_invalid;
160+
161+- for (i = 0; i < n_formats; i++)
162++ for (i = 0; i < n_formats && *sw_pixel_format == mir_pixel_format_invalid; i++)
163+ {
164+- if (formats[i] == mir_pixel_format_argb_8888)
165++ switch (formats[i])
166+ {
167++ case mir_pixel_format_abgr_8888:
168++ case mir_pixel_format_xbgr_8888:
169++ case mir_pixel_format_argb_8888:
170++ case mir_pixel_format_xrgb_8888:
171++ case mir_pixel_format_rgb_565:
172+ *sw_pixel_format = formats[i];
173+ break;
174++ default:
175++ break;
176+ }
177+ }
178+ }
179+@@ -553,22 +560,20 @@ get_pixel_formats (MirConnection *connection,
180+ {
181+ *hw_pixel_format = mir_pixel_format_invalid;
182+
183+- for (i = 0; i < n_formats; i++)
184++ for (i = 0; i < n_formats && *hw_pixel_format == mir_pixel_format_invalid; i++)
185+ {
186+ switch (formats[i])
187+- {
188++ {
189+ case mir_pixel_format_abgr_8888:
190+ case mir_pixel_format_xbgr_8888:
191+ case mir_pixel_format_argb_8888:
192+ case mir_pixel_format_xrgb_8888:
193++ case mir_pixel_format_rgb_565:
194+ *hw_pixel_format = formats[i];
195+ break;
196+ default:
197+- continue;
198+- }
199+-
200+- if (*hw_pixel_format != mir_pixel_format_invalid)
201+- break;
202++ break;
203++ }
204+ }
205+ }
206+ }
207+diff --git a/gdk/mir/gdkmireventsource.c b/gdk/mir/gdkmireventsource.c
208+index 5732f2b..19fa997 100644
209+--- a/gdk/mir/gdkmireventsource.c
210++++ b/gdk/mir/gdkmireventsource.c
211+@@ -298,6 +298,45 @@ handle_key_event (GdkWindow *window, const MirInputEvent *event)
212+ }
213+ }
214+
215++static void
216++handle_touch_event (GdkWindow *window,
217++ const MirTouchEvent *mir_touch_event)
218++{
219++ const MirInputEvent *mir_input_event = mir_touch_event_input_event (mir_touch_event);
220++ guint n = mir_touch_event_point_count (mir_touch_event);
221++ GdkEvent *gdk_event;
222++ guint i;
223++
224++ for (i = 0; i < n; i++)
225++ {
226++ switch (mir_touch_event_action (mir_touch_event, i))
227++ {
228++ case mir_touch_action_up:
229++ gdk_event = gdk_event_new (GDK_TOUCH_END);
230++ break;
231++ case mir_touch_action_down:
232++ gdk_event = gdk_event_new (GDK_TOUCH_BEGIN);
233++ break;
234++ case mir_touch_action_change:
235++ gdk_event = gdk_event_new (GDK_TOUCH_UPDATE);
236++ break;
237++ }
238++
239++ gdk_event->touch.window = window;
240++ gdk_event->touch.sequence = GINT_TO_POINTER (mir_touch_event_id (mir_touch_event, i));
241++ gdk_event->touch.time = mir_input_event_get_event_time (mir_input_event);
242++ gdk_event->touch.state = get_modifier_state (mir_touch_event_modifiers (mir_touch_event), 0);
243++ gdk_event->touch.x = mir_touch_event_axis_value (mir_touch_event, i, mir_touch_axis_x);
244++ gdk_event->touch.y = mir_touch_event_axis_value (mir_touch_event, i, mir_touch_axis_y);
245++ gdk_event->touch.x_root = mir_touch_event_axis_value (mir_touch_event, i, mir_touch_axis_x);
246++ gdk_event->touch.y_root = mir_touch_event_axis_value (mir_touch_event, i, mir_touch_axis_y);
247++ gdk_event->touch.emulating_pointer = TRUE;
248++ _gdk_event_set_pointer_emulated (gdk_event, TRUE);
249++
250++ send_event (window, get_pointer (window), gdk_event);
251++ }
252++}
253++
254+ static guint
255+ get_button_state (const MirPointerEvent *event)
256+ {
257+@@ -515,7 +554,7 @@ gdk_mir_event_source_queue_event (GdkDisplay *display,
258+ handle_key_event (window, input_event);
259+ break;
260+ case mir_input_event_type_touch:
261+- handle_motion_event (window, input_event);
262++ handle_touch_event (window, mir_input_event_get_touch_event (input_event));
263+ break;
264+ case mir_input_event_type_pointer:
265+ handle_motion_event (window, input_event);
266+diff --git a/gdk/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c
267+index 9b3a249..af7badb 100644
268+--- a/gdk/mir/gdkmirwindowimpl.c
269++++ b/gdk/mir/gdkmirwindowimpl.c
270+@@ -280,12 +280,12 @@ send_event (GdkWindow *window, GdkDevice *device, GdkEvent *event)
271+ GdkDisplay *display;
272+ GList *node;
273+
274++ display = gdk_window_get_display (window);
275+ gdk_event_set_device (event, device);
276+ gdk_event_set_source_device (event, device);
277+ gdk_event_set_screen (event, gdk_display_get_screen (gdk_window_get_display (window), 0));
278+ event->any.window = g_object_ref (window);
279+
280+- display = gdk_window_get_display (window);
281+ node = _gdk_event_queue_append (display, event);
282+ _gdk_windowing_got_event (display, node, event, _gdk_display_get_next_serial (display));
283+ }
284+@@ -423,7 +423,42 @@ gdk_mir_window_impl_ref_cairo_surface (GdkWindow *window)
285+ ensure_surface (window);
286+
287+ mir_buffer_stream_get_graphics_region (mir_surface_get_buffer_stream (impl->surface), &region);
288+- g_assert (region.pixel_format == mir_pixel_format_argb_8888);
289++
290++ switch (region.pixel_format)
291++ {
292++ case mir_pixel_format_abgr_8888:
293++ g_warning ("pixel format ABGR 8888 not supported, using ARGB 8888");
294++ pixel_format = CAIRO_FORMAT_ARGB32;
295++ break;
296++ case mir_pixel_format_xbgr_8888:
297++ g_warning ("pixel format XBGR 8888 not supported, using XRGB 8888");
298++ pixel_format = CAIRO_FORMAT_RGB24;
299++ break;
300++ case mir_pixel_format_argb_8888:
301++ pixel_format = CAIRO_FORMAT_ARGB32;
302++ break;
303++ case mir_pixel_format_xrgb_8888:
304++ pixel_format = CAIRO_FORMAT_RGB24;
305++ break;
306++ case mir_pixel_format_bgr_888:
307++ g_error ("pixel format BGR 888 not supported");
308++ break;
309++ case mir_pixel_format_rgb_888:
310++ g_error ("pixel format RGB 888 not supported");
311++ break;
312++ case mir_pixel_format_rgb_565:
313++ pixel_format = CAIRO_FORMAT_RGB16_565;
314++ break;
315++ case mir_pixel_format_rgba_5551:
316++ g_error ("pixel format RGBA 5551 not supported");
317++ break;
318++ case mir_pixel_format_rgba_4444:
319++ g_error ("pixel format RGBA 4444 not supported");
320++ break;
321++ default:
322++ g_error ("unknown pixel format");
323++ break;
324++ }
325+
326+ cairo_surface = cairo_image_surface_create_for_data ((unsigned char *) region.vaddr,
327+ pixel_format,
328+--
329+2.6.2
330+
331
332=== modified file 'debian/patches/series'
333--- debian/patches/series 2015-10-23 16:17:58 +0000
334+++ debian/patches/series 2015-11-02 16:43:04 +0000
335@@ -23,3 +23,4 @@
336 git_icon_fallback.patch
337 git_nameless_devices.patch
338 unity_rbga_tooltips.patch
339+git-refresh-mir-backend.patch

Subscribers

People subscribed via source and target branches

to all changes: