diff options
| -rw-r--r-- | meson.build | 2 | ||||
| -rw-r--r-- | src/window_wayland.c | 11 | ||||
| -rw-r--r-- | src/window_x11.c | 18 |
3 files changed, 26 insertions, 5 deletions
diff --git a/meson.build b/meson.build index dbe46b6..74a4441 100644 --- a/meson.build +++ b/meson.build @@ -113,7 +113,7 @@ elif get_option('window') == 'wayland' wl_client = dependency('wayland-client') wl_cursor = dependency('wayland-cursor') wl_egl = dependency('wayland-egl') - wl_protocols = dependency('wayland-protocols', required: false, allow_fallback: false) + wl_protocols = dependency('wayland-protocols', version: '>=1.32', required: false, allow_fallback: false) if not wl_protocols.found() wl_protocols_datadir = subproject('wayland-protocols', default_options: [ 'tests=false' diff --git a/src/window_wayland.c b/src/window_wayland.c index 530daf2..9479c70 100644 --- a/src/window_wayland.c +++ b/src/window_wayland.c @@ -56,8 +56,6 @@ static void handle_output_done(void *data, struct wl_output *output) { struct stl_monitor_wayland *monitor = (struct stl_monitor_wayland *)data; (void)output; - log_debug("Output discovered: %s (%ux%u) (vertical: %s).", - monitor->m.name, monitor->m.width, monitor->m.height, BOOLSTR(monitor->m.vertical)); if (global.output_discovered) { global.output_discovered(global.userdata, (struct stl_monitor *)monitor); } @@ -324,6 +322,7 @@ s32 stl_swallow_main(u32 argc, str *argv, s32 (*main)(u32, str *, void *), void void stl_global_close(void) { + if (!global.display) return; #ifdef STELA_API_OPENGL stl_terminate_egl(&global.egl); #endif @@ -502,6 +501,7 @@ static void pointer_axis_value120(void *data, struct wl_pointer *pointer, (void)value120; } +/* static void pointer_axis_relative_direction(void *data, struct wl_pointer *pointer, u32 axis, u32 direction) { @@ -510,6 +510,7 @@ static void pointer_axis_relative_direction(void *data, struct wl_pointer *point (void)axis; (void)direction; } +*/ static const struct wl_pointer_listener pointer_listener = { .enter = pointer_enter, @@ -522,7 +523,7 @@ static const struct wl_pointer_listener pointer_listener = { .axis_stop = pointer_axis_stop, .axis_discrete = pointer_axis_discrete, .axis_value120 = pointer_axis_value120, - .axis_relative_direction = pointer_axis_relative_direction + //.axis_relative_direction = pointer_axis_relative_direction }; static void keyboard_keymap(void *data, struct wl_keyboard *keyboard, @@ -692,6 +693,7 @@ static void handle_surface_leave(void *data, struct wl_surface *surface, struct (void)output; } +/* static void preferred_buffer_scale(void *data, struct wl_surface *surface, s32 factor) { (void)data; @@ -705,12 +707,15 @@ static void preferred_buffer_transform(void *data, struct wl_surface *surface, u (void)surface; (void)transform; } +*/ static const struct wl_surface_listener surface_listener = { .enter = handle_surface_enter, .leave = handle_surface_leave, + /* .preferred_buffer_scale = preferred_buffer_scale, .preferred_buffer_transform = preferred_buffer_transform + */ }; static bool check_and_set_dimensions(struct stl_window_wayland *wl, s32 event_width, s32 event_height) diff --git a/src/window_x11.c b/src/window_x11.c index 06b6d51..cf54ba1 100644 --- a/src/window_x11.c +++ b/src/window_x11.c @@ -76,7 +76,7 @@ bool stl_global_init(bool skip_graphics) s32 stl_global_get_poll_fd() { - al_assert_and_return(-1); + return XConnectionNumber(global.x11_d); } void stl_global_process_events() @@ -91,6 +91,7 @@ s32 stl_swallow_main(u32 argc, str *argv, s32 (*main)(u32, str *, void *), void void stl_global_close(void) { + if (!global.x11_d) return; #ifdef STELA_API_OPENGL stl_terminate_egl(&global.egl); #endif @@ -169,6 +170,21 @@ static bool window_x11_create_window(struct stl_window *window, u32 width, u32 h PropModeAppend, (u8*)&net_wm_sticky, 1); } + Atom motif_wm_hints = XInternAtom(global.x11_d, "_MOTIF_WM_HINTS", False); + if (motif_wm_hints) { + struct { + ulong flags; + ulong functions; + ulong decorations; + long input_mode; + ulong status; + } hints = { 0 }; + hints.flags = 2; + hints.decorations = 0; + XChangeProperty(global.x11_d, xw->window, motif_wm_hints, motif_wm_hints, 32, + PropModeReplace, (u8 *)&hints, sizeof(hints) / sizeof(long)); + } + Atom net_wm_desktop = XInternAtom(global.x11_d, "_NET_WM_DESKTOP", False); if (net_wm_desktop) { ulong all_desktops = XWIN_ALL_DESKTOPS; |