summaryrefslogtreecommitdiff
path: root/src/drivers/Wayland
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-05-02 17:59:08 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-05-02 17:59:08 +0200
commit9ffeef76975579e0d838ea781a64ec66b92c9851 (patch)
tree5d7610010159007e6620ff4a9c548ecf5b5cbe4a /src/drivers/Wayland
parentef5bf602399c07ff534b28089d9e7baee98d9911 (diff)
Wayland: problem with menus on secondary monitor - cont'd (#724)
Diffstat (limited to 'src/drivers/Wayland')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
index eb7915e0e..cedd04502 100644
--- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
@@ -1277,13 +1277,23 @@ void Fl_Wayland_Window_Driver::makeWindow()
Fl::e_number = old_event;
// make sure each popup is mapped with its constraints before mapping next popup
if (pWindow->menu_window() && !is_floatingtitle) {
- int count = 0; // attempt to map the menuwindow (i.e., until it appears on a screen)
- while (!new_window->output && count <= 5) {
- wl_display_roundtrip(scr_driver->wl_display);
- count++;
+ int HH;
+ Fl_Window_Driver::menu_parent(&HH);
+ bool simple = (menu_bartitle(pWindow) || is_menutitle(pWindow) || pWindow->h() > HH);
+ if (!simple) {
+ simple = (menu_leftorigin(pWindow) != NULL);
}
- if (!new_window->output) {
-//printf("menuwindow doesn't map: count=%d\n",count);
+ if (simple) {
+ pWindow->wait_for_expose();
+ } else {
+ int count = 0; // attempt to map the menuwindow (i.e., until it appears on a screen)
+ while (!new_window->output && count <= 5) {
+ wl_display_roundtrip(scr_driver->wl_display);
+ count++;
+ }
+ }
+ if (!new_window->output && !simple) {
+//printf("menuwindow doesn't map: pWindow=%p\n",pWindow);
// On a secondary display, the menuwindow may fail to map in what looks like
// a bug in the compositor. Bypass this problem by attempting again to create
// the menuwindow with another constraint: XDG_POSITIONER_GRAVITY_TOP_RIGHT