mirror of
https://github.com/fltk/fltk.git
synced 2026-05-27 10:57:58 +08:00
Wayland: accept diverse versions of the GTK Shell protocol
This commit is contained in:
@@ -205,8 +205,10 @@ static void pointer_enter(void *data, struct wl_pointer *wl_pointer, uint32_t se
|
|||||||
struct wl_surface *surface, wl_fixed_t surface_x, wl_fixed_t surface_y) {
|
struct wl_surface *surface, wl_fixed_t surface_x, wl_fixed_t surface_y) {
|
||||||
struct Fl_Wayland_Screen_Driver::seat *seat = (struct Fl_Wayland_Screen_Driver::seat*)data;
|
struct Fl_Wayland_Screen_Driver::seat *seat = (struct Fl_Wayland_Screen_Driver::seat*)data;
|
||||||
Fl_Window *win = event_coords_from_surface(surface, surface_x, surface_y);
|
Fl_Window *win = event_coords_from_surface(surface, surface_x, surface_y);
|
||||||
static bool using_GTK = true;
|
static bool using_GTK = seat->gtk_shell &&
|
||||||
if (!win && seat->gtk_shell && using_GTK) { // check whether surface is the headerbar of a GTK-decorated window
|
(gtk_shell1_get_version(seat->gtk_shell) >= GTK_SURFACE1_TITLEBAR_GESTURE_SINCE_VERSION);
|
||||||
|
if (!win && using_GTK) {
|
||||||
|
// check whether surface is the headerbar of a GTK-decorated window
|
||||||
Fl_X *xp = Fl_X::first;
|
Fl_X *xp = Fl_X::first;
|
||||||
while (xp && using_GTK) { // all mapped windows
|
while (xp && using_GTK) { // all mapped windows
|
||||||
struct wld_window *xid = (struct wld_window*)xp->xid;
|
struct wld_window *xid = (struct wld_window*)xp->xid;
|
||||||
@@ -1257,10 +1259,8 @@ static void registry_handle_global(void *user_data, struct wl_registry *wl_regis
|
|||||||
} else if (strcmp(interface, "gtk_shell1") == 0) {
|
} else if (strcmp(interface, "gtk_shell1") == 0) {
|
||||||
Fl_Wayland_Screen_Driver::compositor = Fl_Wayland_Screen_Driver::MUTTER;
|
Fl_Wayland_Screen_Driver::compositor = Fl_Wayland_Screen_Driver::MUTTER;
|
||||||
//fprintf(stderr, "Running the Mutter compositor\n");
|
//fprintf(stderr, "Running the Mutter compositor\n");
|
||||||
if ( version >= 5) {
|
scr_driver->seat->gtk_shell = (struct gtk_shell1*)wl_registry_bind(wl_registry, id,
|
||||||
scr_driver->seat->gtk_shell = (struct gtk_shell1*)wl_registry_bind(wl_registry, id,
|
>k_shell1_interface, version);
|
||||||
>k_shell1_interface, 5);
|
|
||||||
}
|
|
||||||
} else if (strcmp(interface, "weston_desktop_shell") == 0) {
|
} else if (strcmp(interface, "weston_desktop_shell") == 0) {
|
||||||
Fl_Wayland_Screen_Driver::compositor = Fl_Wayland_Screen_Driver::WESTON;
|
Fl_Wayland_Screen_Driver::compositor = Fl_Wayland_Screen_Driver::WESTON;
|
||||||
//fprintf(stderr, "Running the Weston compositor\n");
|
//fprintf(stderr, "Running the Weston compositor\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user