[gtk+] wayland: Add support for output device removal
- From: Rob Bradford <rbradford src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] wayland: Add support for output device removal
- Date: Thu, 14 Feb 2013 13:30:40 +0000 (UTC)
commit 4e1d99994073a0d16d02b6c29474c4700e1d9318
Author: Rob Bradford <rob linux intel com>
Date: Thu Feb 14 13:28:07 2013 +0000
wayland: Add support for output device removal
Since we only receive an object id for the removed object we must try and
remove that from the list of devices based on that id.
gdk/wayland/gdkdisplay-wayland.c | 9 +++++++--
gdk/wayland/gdkprivate-wayland.h | 4 ++--
gdk/wayland/gdkscreen-wayland.c | 17 +++++++++++++++--
3 files changed, 24 insertions(+), 6 deletions(-)
---
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index ecb0e64..24f5ceb 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -125,9 +125,14 @@ gdk_registry_handle_global(void *data, struct wl_registry *registry, uint32_t id
}
static void
-gdk_registry_handle_global_remove(void *data,
- struct wl_registry *registry, uint32_t name)
+gdk_registry_handle_global_remove(void *data,
+ struct wl_registry *registry,
+ uint32_t id)
{
+ GdkWaylandDisplay *display_wayland = data;
+
+ /* We don't know what this item is - try as an output */
+ _gdk_wayland_screen_remove_output_by_id (display_wayland->screen, id);
}
static const struct wl_registry_listener registry_listener = {
diff --git a/gdk/wayland/gdkprivate-wayland.h b/gdk/wayland/gdkprivate-wayland.h
index 21684d8..a80dd15 100644
--- a/gdk/wayland/gdkprivate-wayland.h
+++ b/gdk/wayland/gdkprivate-wayland.h
@@ -146,8 +146,8 @@ GdkWindow *_gdk_wayland_screen_create_root_window (GdkScreen *screen,
GdkScreen *_gdk_wayland_screen_new (GdkDisplay *display);
void _gdk_wayland_screen_add_output (GdkScreen *scren,
struct wl_output *output);
-void _gdk_wayland_screen_remove_output (GdkScreen *screen,
- struct wl_output *output);
+void _gdk_wayland_screen_remove_output_by_id (GdkScreen *screen,
+ guint32 id);
void _gdk_wayland_display_manager_add_display (GdkDisplayManager *manager,
GdkDisplay *display);
diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c
index d30cc7c..b69d783 100644
--- a/gdk/wayland/gdkscreen-wayland.c
+++ b/gdk/wayland/gdkscreen-wayland.c
@@ -597,7 +597,20 @@ _gdk_wayland_screen_add_output (GdkScreen *screen,
}
void
-_gdk_wayland_screen_remove_output (GdkScreen *screen,
- struct wl_output *output)
+_gdk_wayland_screen_remove_output_by_id (GdkScreen *screen,
+ guint32 id)
{
+ GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
+ int i;
+
+ for (i = 0; i < screen_wayland->monitors->len; i++)
+ {
+ GdkWaylandMonitor *monitor = screen_wayland->monitors->pdata[i];
+
+ if (wl_proxy_get_id ((struct wl_proxy *)monitor->output) == id)
+ {
+ g_ptr_array_remove (screen_wayland->monitors, monitor);
+ break;
+ }
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]