diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-11-05 15:28:39 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-11-05 15:28:39 +0100 |
| commit | 918395e0916a6ae48663b41173f5c0d887dcc347 (patch) | |
| tree | 96ca0166a79df60f37d4b8d84064704b97880705 /src | |
| parent | e133d3af2bb53e52847fa655b3aef5c8cfc6889e (diff) | |
Wayland: simpler handling of the z-order of subwindows
It's not necessary to call wl_subsurface_place_above() because
"A new sub-surface is initially added as the top-most in the stack of its siblings and parent."
Diffstat (limited to 'src')
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx index b7c07a38b..d3df1494b 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx @@ -953,25 +953,8 @@ static Fl_Window *calc_transient_parent(int ¢er_x, int ¢er_y) { Fl_Window *top = Fl::first_window()->top_window(); while (top && top->user_data() == &Fl_Screen_Driver::transient_scale_display) top = Fl::next_window(top); - Fl_Window *target = top; - // search if top's center belongs to one of its subwindows center_x = top->w()/2; center_y = top->h()/2; - while (target) { - Fl_Window *child = Fl::first_window(); - while (child) { - if (child->window() == target && child->user_data() != &Fl_Screen_Driver::transient_scale_display && - child->x() <= center_x && child->x()+child->w() > center_x && - child->y() <= center_y && child->y()+child->h() > center_y) { - break; // child contains the center of top - } - child = Fl::next_window(child); - } - if (!child) break; // no more subwindow contains the center of top - target = child; - center_x -= child->x(); // express center coordinates relatively to child - center_y -= child->y(); - } - return target; + return top; } @@ -1084,7 +1067,6 @@ Fl_X *Fl_Wayland_Window_Driver::makeWindow() float f = Fl::screen_scale(pWindow->top_window()->screen_num()); wl_subsurface_set_position(new_window->subsurface, pWindow->x() * f, pWindow->y() * f); wl_subsurface_set_desync(new_window->subsurface); // important - wl_subsurface_place_above(new_window->subsurface, parent->wl_surface); // next 3 statements ensure the subsurface will be mapped because: // "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(); |
