diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2025-03-17 19:02:36 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2025-03-18 18:17:49 +0100 |
| commit | 3f4712957c67d126b6e32af2400097615d936270 (patch) | |
| tree | ab6090375e547c7ef863cc0c6cbc1dfe78975856 /src | |
| parent | 622c1f1db8d7dbee2b12f1f9ca54bdd0226d650a (diff) | |
Wayland: improve support of screen removal while FLTK runs
Diffstat (limited to 'src')
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx | 1 | ||||
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx | 6 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx index 534d70bb5..f73639598 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx @@ -1656,6 +1656,7 @@ static int workarea_xywh[4] = { -1, -1, -1, -1 }; void Fl_Wayland_Screen_Driver::init_workarea() { + wl_display_roundtrip(Fl_Wayland_Screen_Driver::wl_display); // important after screen removal Fl_Wayland_Screen_Driver::output *output, *mainscreen = NULL; wl_list_for_each(output, &outputs, link) { int Wfullscreen, Hfullscreen, Wworkarea, Hworkarea; diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx index 4a617ff44..cb42e813f 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx @@ -693,8 +693,6 @@ void change_scale(Fl_Wayland_Screen_Driver::output *output, struct wld_window *w Fl::add_timeout(0, (Fl_Timeout_Handler)delayed_rescale, window->fl_win); } } - if (window->fl_win->as_gl_window()) - wl_surface_set_buffer_scale(window->wl_surface, output->wld_scale); } @@ -710,8 +708,6 @@ static void surface_enter(void *data, struct wl_surface *wl_surface, if (output == NULL) return; - Fl_Wayland_Window_Driver *win_driver = Fl_Wayland_Window_Driver::driver(window->fl_win); - float pre_scale = Fl::screen_scale(win_driver->screen_num()) * win_driver->wld_scale(); bool list_was_empty = wl_list_empty(&window->outputs); struct Fl_Wayland_Window_Driver::surface_output *surface_output = (struct Fl_Wayland_Window_Driver::surface_output*)malloc( @@ -723,7 +719,7 @@ static void surface_enter(void *data, struct wl_surface *wl_surface, wl_list_insert(e, &surface_output->link); //printf("window %p enters screen id=%d length=%d\n", window->fl_win, output->id, wl_list_length(&window->outputs)); if (list_was_empty && !window->fl_win->parent()) { - change_scale(output, window, pre_scale); + change_scale(output, window, 0); } } |
