forked from AuroraMiddleware/gtk
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.
This commit is contained in:
parent
fab808f92c
commit
4e1d999940
@ -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 = {
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user