Commit Graph

1434 Commits

Author SHA1 Message Date
ManoloFLTK
e6440ca0a8 Wayland mouse wheel support: compositors can behave differently 2023-08-15 08:44:53 +02:00
Albrecht Schlosser
3c7610ec23 Handle shift + mousewheel event on Wayland (STR 3521)
Pressing the shift key while using the mousewheel changes
horizontal to vertical scrolling and vice versa. This allows users
with a standard mouse with only one scrollwheel to use it for both
scrolling directions.

This concludes "handling shift + mousewheel" for all supported platforms.
2023-08-14 16:57:33 +02:00
ManoloFLTK
1943fe54c8 Wayland: fix fl_read_image() from offscreen buffer 2023-08-09 10:31:36 +02:00
ManoloFLTK
27c3d0b780 Wayland: improve layout of struct fl_wld_draw_buffer 2023-08-08 16:08:53 +02:00
ManoloFLTK
45d119eb3c Move repeated code to Fl_Wayland_Graphics_Driver::cairo_init() 2023-08-08 09:05:12 +02:00
ManoloFLTK
2953db58c7 Let FLTK give more detailed description of a Wayland fatal error
Wayland protocol error messages now give the protocol name and the error code.
2023-08-05 12:09:13 +02:00
ManoloFLTK
c427f037ce Improve procedure to close decorated Wayland window
Libdecor complicates what should be simple, to close a decorated window,
because it uses the titlebar after return from the closing callback function.
Thus, FLTK delays the sending of the FL_CLOSE event to the window,
only when libdecor runs in CSD mode.
2023-08-04 19:14:13 +02:00
ManoloFLTK
0bf6a4b044 Slightly improve Fl_Wayland_Screen_Driver::poll_or_select_with_delay() 2023-08-03 08:12:08 +02:00
ManoloFLTK
e49f2008a6 Fix Fl_Wayland_Image_Surface_Driver::end_current() 2023-08-02 16:10:41 +02:00
ManoloFLTK
b440c26e65 Wayland: fix window closing with Sway's kill command or app menu 2023-08-02 10:04:45 +02:00
ManoloFLTK
e12eb99b5d Wayland: add test to avoid null pointer dereferencing 2023-07-31 19:26:37 +02:00
ManoloFLTK
7feddabd24 Implement Fl_Wayland_Screen_Driver::poll_or_select_with_delay(double) 2023-07-31 16:29:15 +02:00
ManoloFLTK
b1ab37eeff Wayland: simpler use of function eglChooseConfig() 2023-07-29 14:16:18 +02:00
ManoloFLTK
d9fa2c6082 Wayland.dox: add info about the xdg decoration protocol
Also, use KWin to name the KDE desktop's Wayland compositor.
2023-07-28 15:27:38 +02:00
ManoloFLTK
cdd617d094 Wayland: slightly improve procedure to close toplevel window 2023-07-21 15:34:24 +02:00
ManoloFLTK
6f05af3c12 Wayland: add control of targeted screen by fullscreen windows 2023-07-13 18:19:01 +02:00
Albrecht Schlosser
44840af076 Wayland: keep mouse button state across push/release events
Notes:

(1) Fl::e_state holds the current state of all mouse buttons which is
    returned by Fl::event_buttons() - "plural form".

(2) Fl::e_keysym holds the "key" of the current event which can be a
    mouse button, returned by Fl::event_button() - "singular form".
2023-07-12 18:49:01 +02:00
Albrecht Schlosser
858c3cad86 Fix Wayland FL_RELEASE events reporting wrong button
... in Fl::event_button().

This can be seen when two buttons have been pressed simultaneously
and then released (see test/handle_events.cxx).
2023-07-12 18:05:07 +02:00
ManoloFLTK
8bb29e823c Have Fl_Wayland_Window_Driver use Fl::add_check() when adequate 2023-06-28 08:47:21 +02:00
ManoloFLTK
f5879ae228 Slight simplification of Fl_Wayland_Gl_Window_Driver::swap_buffers()
Also, reorder members of class Fl_Wayland_Gl_Window_Driver
2023-06-27 09:05:46 +02:00
ManoloFLTK
81615bbe0b Fix Fl_Cocoa_Gl_Window_Driver::resize()
The additional [NSOpenGLContext flushBuffer] messages appear necessary when an Fl_Tile contains
2 or more GL subwindows.
2023-06-26 15:00:52 +02:00
ManoloFLTK
5196d66825 Wayland: improve mapping and hiding of GL (subs)windows 2023-06-24 09:23:01 +02:00
ManoloFLTK
38381ef544 Slightly simpler Fl_Wayland_Window_Driver::hide() 2023-06-23 10:03:30 +02:00
ManoloFLTK
c43cf2f192 Wayland: improve support of multi-display setups 2023-06-19 17:48:37 +02:00
ManoloFLTK
742af8a31a Wayland: fix menutitle windows with scaled, multiple display 2023-06-13 14:39:03 +02:00
ManoloFLTK
033ad1d732 Fix "Fl::get_font_name() with Pango is inconsistent"-cont'd (#732) 2023-06-06 16:55:05 +02:00
ManoloFLTK
bba90ce005 Fix "Fl::get_font_name() with Pango is inconsistent"-cont'd (#732) 2023-06-06 08:27:52 +02:00
ManoloFLTK
11c38c3e41 Fix "Fl::get_font_name() with Pango is inconsistent"-cont'd (#732) 2023-06-06 08:22:32 +02:00
ManoloFLTK
fcca08d841 Fix "Fl::get_font_name() with Pango is inconsistent"-cont'd (#732) 2023-06-05 17:28:34 +02:00
ManoloFLTK
64eafbefd6 Fix "Fl::get_font_name() with Pango is inconsistent" (#732) 2023-06-05 16:05:27 +02:00
ManoloFLTK
5be3fbf913 Improve re-use of client/compositor shared memory by Wayland buffers 2023-06-05 11:00:33 +02:00
ManoloFLTK
06fc052e5c Fix "Huge memory leak under Wayland" (#730) 2023-06-01 17:09:16 +02:00
ManoloFLTK
c3217094db Slightly simplify Fl_Wayland_Window_Driver::makeWindow() 2023-05-31 07:05:18 +02:00
ManoloFLTK
4c057c57ae Slightly improve Fl_Wayland_Window_Driver::flush() 2023-05-22 17:46:08 +02:00
ManoloFLTK
7020356df9 Slightly re-organize class Fl_Wayland_Window_Driver 2023-05-22 09:05:07 +02:00
ManoloFLTK
60440632ee Fix name of static member variable Fl_Wayland_Screen_Driver::wl_display
and add explanatory comment.
2023-05-20 06:05:34 +02:00
ManoloFLTK
033880673a Add null-pointer check for tall menu window under Wayland+KDE 2023-05-17 09:39:39 +02:00
ManoloFLTK
e5ac5678dc 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.
2023-05-15 12:40:24 +02:00
ManoloFLTK
1555132df1 Wayland: improve tall menu window support with xdg_positioner_set_offset() 2023-05-13 16:29:51 +02:00
ManoloFLTK
7a50c8234a Wayland: slightly simpler surface_enter() for toplevel GL windows 2023-05-12 08:47:56 +02:00
ManoloFLTK
7ef6b9f802 Wayland: fix opening GL top-level window on 2-screen system - cont'd 2023-05-11 18:59:34 +02:00
ManoloFLTK
37abac2d8e Wayland: fix opening GL top-level window on 2-screen system 2023-05-11 18:42:07 +02:00
ManoloFLTK
89a2b1a7a8 Fl_Wayland_Screen_Driver::get_system_scheme() is not needed 2023-05-03 14:17:10 +02:00
ManoloFLTK
a94fed77e4 Wayland: clearer procedure to complete initialisation of screen data 2023-05-03 08:50:19 +02:00
ManoloFLTK
9ffeef7697 Wayland: problem with menus on secondary monitor - cont'd (#724) 2023-05-02 17:59:08 +02:00
ManoloFLTK
ef5bf60239 Wayland: problem with dropdown menus on secondary monitor (#724) 2023-05-02 14:50:33 +02:00
ManoloFLTK
0394a27074 Wayland: wl_cursor_theme_load() may return NULL 2023-05-01 21:41:26 +02:00
ManoloFLTK
02c7ee5128 Fix regression in Fl::screeen_xywh() introduced at 9ea0cc8 2023-05-01 21:10:43 +02:00
ManoloFLTK
ae65a6bf99 Check return values of calls to libxkbcommon functions (#727) 2023-05-01 17:36:36 +02:00
ManoloFLTK
7a8343e7e4 Fix crash reported in issues #723 and #724 2023-04-29 17:06:55 +02:00