forked from AuroraMiddleware/gtk
Merge branch 'xdg-output-v3-gtk3' into 'gtk-3-24'
wayland: Add xdg-output v3 support See merge request GNOME/gtk!1021
This commit is contained in:
commit
92ffcbadc4
@ -515,11 +515,12 @@ gdk_registry_handle_global (void *data,
|
||||
}
|
||||
else if (strcmp(interface, "zxdg_output_manager_v1") == 0)
|
||||
{
|
||||
display_wayland->xdg_output_manager_version = MIN (version, 2);
|
||||
display_wayland->xdg_output_manager_version = MIN (version, 3);
|
||||
display_wayland->xdg_output_manager =
|
||||
wl_registry_bind (display_wayland->wl_registry, id,
|
||||
&zxdg_output_manager_v1_interface,
|
||||
display_wayland->xdg_output_manager_version);
|
||||
display_wayland->xdg_output_version = version;
|
||||
_gdk_wayland_screen_init_xdg_output (display_wayland->screen);
|
||||
_gdk_wayland_display_async_roundtrip (display_wayland);
|
||||
}
|
||||
|
@ -95,6 +95,7 @@ struct _GdkWaylandDisplay
|
||||
struct zwp_keyboard_shortcuts_inhibit_manager_v1 *keyboard_shortcuts_inhibit;
|
||||
struct org_kde_kwin_server_decoration_manager *server_decoration_manager;
|
||||
struct zxdg_output_manager_v1 *xdg_output_manager;
|
||||
uint32_t xdg_output_version;
|
||||
|
||||
GList *async_roundtrips;
|
||||
|
||||
|
@ -87,6 +87,7 @@ struct _GdkWaylandScreenClass
|
||||
};
|
||||
|
||||
#define OUTPUT_VERSION_WITH_DONE 2
|
||||
#define NO_XDG_OUTPUT_DONE_SINCE_VERSION 3
|
||||
|
||||
#define GTK_SETTINGS_DBUS_PATH "/org/gtk/Settings"
|
||||
#define GTK_SETTINGS_DBUS_NAME "org.gtk.Settings"
|
||||
@ -1449,6 +1450,7 @@ apply_monitor_change (GdkWaylandMonitor *monitor)
|
||||
{
|
||||
GdkDisplay *display = GDK_MONITOR (monitor)->display;
|
||||
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (gdk_display_get_default_screen (display));
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
|
||||
GDK_NOTE (MISC,
|
||||
g_message ("monitor %d changed position %d %d, size %d %d",
|
||||
@ -1460,7 +1462,11 @@ apply_monitor_change (GdkWaylandMonitor *monitor)
|
||||
gdk_monitor_set_size (GDK_MONITOR (monitor), monitor->width, monitor->height);
|
||||
gdk_monitor_set_connector (GDK_MONITOR (monitor), monitor->name);
|
||||
monitor->wl_output_done = FALSE;
|
||||
monitor->xdg_output_done = FALSE;
|
||||
/* xdg_output v3 marks xdg_output.done as deprecated, so if using
|
||||
* that version, no need to wait for xdg-output.done event.
|
||||
*/
|
||||
monitor->xdg_output_done =
|
||||
(display_wayland->xdg_output_version >= NO_XDG_OUTPUT_DONE_SINCE_VERSION);
|
||||
|
||||
g_signal_emit_by_name (screen_wayland, "monitors-changed");
|
||||
update_screen_size (screen_wayland);
|
||||
|
Loading…
Reference in New Issue
Block a user