summaryrefslogtreecommitdiff
path: root/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-02-02 14:39:11 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-02-02 14:39:11 +0100
commitddc213d91c28e5f0729a7f397e88104baa7024bc (patch)
treede22a273db274a8c47cbd4c02db29427b32d3354 /src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
parent96fd8a5f7a78730465a3fc3dcdab90b508bbab43 (diff)
Add preliminary support of Wayland under macOS
Wayland under macOS is WIP at https://github.com/owl-compositor/owl
Diffstat (limited to 'src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
index 97a8d34da..b54acac2f 100644
--- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
@@ -873,6 +873,16 @@ static void xdg_toplevel_configure(void *data, struct xdg_toplevel *xdg_toplevel
}
window->configured_width = ceil(width / f);
window->configured_height = ceil(height / f);
+ if (Fl_Wayland_Screen_Driver::compositor == Fl_Wayland_Screen_Driver::OWL) {
+ Fl_Window *sub = Fl::first_window();
+ while (sub) { // search still un-exposed sub-windows
+ if (sub->window() == window->fl_win) {
+ Fl_Window_Driver::driver(sub)->wait_for_expose_value = 0;
+ break;
+ }
+ sub = Fl::next_window(sub);
+ }
+ }
}
@@ -1145,7 +1155,9 @@ void Fl_Wayland_Window_Driver::makeWindow()
if (pWindow->menu_window() || pWindow->tooltip_window()) { // a menu window or tooltip
is_floatingtitle = process_menu_or_tooltip(new_window);
- } else if ( pWindow->border() && !pWindow->parent() ) { // a decorated window
+ // Don't attempt to use libdecor with OWL
+ } else if (Fl_Wayland_Screen_Driver::compositor != Fl_Wayland_Screen_Driver::OWL &&
+ pWindow->border() && !pWindow->parent() ) { // a decorated window
new_window->kind = DECORATED;
if (!scr_driver->libdecor_context)
scr_driver->libdecor_context = libdecor_new(Fl_Wayland_Screen_Driver::wl_display, &libdecor_iface);
@@ -1175,7 +1187,11 @@ void Fl_Wayland_Window_Driver::makeWindow()
// "A sub-surface becomes mapped, when a non-NULL wl_buffer is applied and the parent surface is mapped."
new_window->configured_width = pWindow->w();
new_window->configured_height = pWindow->h();
- wait_for_expose_value = 0;
+ if (Fl_Wayland_Screen_Driver::compositor != Fl_Wayland_Screen_Driver::OWL) {
+ // With OWL, delay zeroing of subwindow's wait_for_expose_value until
+ // after their parent is configured, see xdg_toplevel_configure().
+ wait_for_expose_value = 0;
+ }
pWindow->border(0);
checkSubwindowFrame(); // make sure subwindow doesn't leak outside parent