From e5ac5678dc4a4d22ad9ca1e088c656c4e5f9b1e9 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Mon, 15 May 2023 12:40:24 +0200 Subject: Fix handling of tall menu windows with the KDE Wayland compositor Unfortunately (sigh), the KDE Wayland compositor does not seem to support correctly, that is, as described by the Wayland protocol, popup windows that are taller than the display : there is no means to make it draw such popup so that part of it is above the screen top, whereas the 3 other tested compositors (Mutter, Weston, Sway) don't have this problem. This commit implements a new approach to draw tall menu windows, and uses it only with the KDE compositor : instead of asking the compositor to slide the menu window up, the menu window remains at a fixed position and the graphics inside the window is slided up. This requires to add a member variable, int offset_y, to class menuwindow, that gets used only for the Wayland platform and that contains the vertical offset by which graphics to the menu window is moved, expressed in FLTK units. An accessor to the address of this member variable is added to class Fl_Window_Driver. --- src/Fl_Window_Driver.H | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Fl_Window_Driver.H') diff --git a/src/Fl_Window_Driver.H b/src/Fl_Window_Driver.H index 0149d28b0..9d7588d9d 100644 --- a/src/Fl_Window_Driver.H +++ b/src/Fl_Window_Driver.H @@ -200,6 +200,7 @@ public: static int menu_itemheight(Fl_Window*); static int menu_bartitle(Fl_Window*); static int menu_selected(Fl_Window*); + static int *menu_offset_y(Fl_Window*); static bool is_floating_title(Fl_Window *); static void scroll_to_selected_item(Fl_Window *); static bool is_menutitle(Fl_Window *); -- cgit v1.2.3