Commit Graph

127 Commits

Author SHA1 Message Date
ManoloFLTK
888dc5f5c5 Have libdecor-gtk implement the "GTK Shell" protocol 2023-11-12 19:13:35 +01:00
ManoloFLTK
ce9ba4ba08 Remove unseless code in Fl_Wayland_Screen_Driver.cxx 2023-11-12 08:40:37 +01:00
ManoloFLTK
ff134f0081 Wayland: make fl_close_display() free more resources 2023-11-09 07:58:08 +01:00
ManoloFLTK
5989caf070 Wayland: fix crash in editor after return from switching user 2023-11-08 10:25:08 +01:00
ManoloFLTK
93b26e4d3b Let Wayland FLTK client apps survive switching user 2023-11-08 09:18:30 +01:00
ManoloFLTK
8b31954d66 "hitting esc to close fltk app blows out the window manager" (#821) 2023-11-07 11:32:12 +01:00
ManoloFLTK
d4d72cfdaf Related to "FLTK doesn't work normal on platform of rockchip" (#817) 2023-11-03 22:10:01 +01:00
ManoloFLTK
3307a1281f Prepare Fl_Wayland_Screen_driver.cxx for removal of Fl_Int_Vector 2023-10-23 16:21:16 +02:00
Albrecht Schlosser
1209e9dcd7 Make Fl_String and Fl_Int_Vector private (#789)
- add CMake option 'OPTION_USE_STD'
- add configure option '--enable-use_std'
- move FL/Fl_String.H to src/Fl_String.H
- move FL/Fl_Int_Vector.H to src/Fl_Int_Vector.H
- remove Fl_String from demo program examples/callbacks.cxx
- remove Fl_Int_Vector from public header FL/Fl_Table.H
- some methods of Fl_Table are no longer inline
- add CMake option OPTION_USE_STD to allow std::string in some
  selected functions and methods

Experimental, may be removed before release:

- use either Fl_Int_Vector or std::vector in Fl_Table depending
  on CMake OPTION_USE_STD or configure --enable-use_std

Move all fl_filename* functions that use Fl_String to fluid

Main changes in fluid:
 - add fluid_filename.h and .cxx
 - include "fluid_filename.h" rather than <FL/filename.H>

Update fl_input(), fl_password() and test/ask

- add maxchar parameter to fl_input() and fl_password()
- fl_input_str() and fl_password_str() are optional and return
  std::string if enabled (FLTK_USE_STD)
2023-10-22 19:35:17 +02:00
Albrecht Schlosser
01038e832a Fix trailing whitespace and dependencies 2023-10-13 19:08:30 +02:00
ManoloFLTK
c274ae1365 Remove obsolete comments 2023-10-13 15:30:12 +02:00
ManoloFLTK
6571bd2f28 Wayland: whitespace only changes 2023-10-05 17:07:55 +02:00
ManoloFLTK
a26e12590c Step back commit 8248183 that's unsatisfactory while resizing windows 2023-09-18 13:06:13 +02:00
ManoloFLTK
be07e5448f Improve reuse of mmap'ed data by Wayland buffers 2023-09-17 13:05:50 +02:00
ManoloFLTK
ee0f173d9f Undo commit 5ea7a04 which requires Mutter V12
That commit's goal was to use an algorithm that does not assume
that number keys are at keycodes 10-19, which may not hold with
"special" keyboards. Unfortunately, the new algorithm requires
Mutter V12 and fails with Mutter V11, used by Debian 12.
2023-08-23 15:59:04 +02:00
ManoloFLTK
ac7c3297fa Undo commit 0a31225 which killed "caps lock" 2023-08-20 19:20:25 +02:00
ManoloFLTK
0a312259a2 Simpler function process_wld_key(() 2023-08-20 18:58:37 +02:00
ManoloFLTK
5ea7a0465e Wayland: process number keys independently of keyboard layout
The new algorithm supports alternate keyboard layouts, e.g., Dvorak.
2023-08-20 16:29:14 +02:00
ManoloFLTK
3384776f8e Improve handling of type Fl_Offscreen under Wayland
Type Fl_Offscreen is now to be cast to cairo_t*.
Also, make sure the dimensions of GL windows are
multiples of the screen scale factor.
2023-08-18 18:02:35 +02:00
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
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
0bf6a4b044 Slightly improve Fl_Wayland_Screen_Driver::poll_or_select_with_delay() 2023-08-03 08:12:08 +02:00
ManoloFLTK
7feddabd24 Implement Fl_Wayland_Screen_Driver::poll_or_select_with_delay(double) 2023-07-31 16:29:15 +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
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
c43cf2f192 Wayland: improve support of multi-display setups 2023-06-19 17:48:37 +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
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
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
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
04e996ee81 Improve integration with the OWL Wayland compositor 2023-04-28 09:47:20 +02:00
ManoloFLTK
9ea0cc89fb Slightly simpler Fl_Wayland_Screen_Driver::open_display_platform() 2023-04-27 17:06:46 +02:00
ManoloFLTK
8489a245ee Wayland: accept all data_device_manager protocol versions 2023-04-25 10:25:34 +02:00
ManoloFLTK
1ae25242bd Wayland: set required version of wl_seat protocol to 2 2023-04-25 09:35:46 +02:00
ManoloFLTK
9a00f36113 Wayland: keep window resizable after native file chooser - cont'd 2023-04-20 16:45:18 +02:00
ManoloFLTK
bcab001eb5 Wayland: keep window resizable after native file chooser 2023-04-20 15:29:40 +02:00
ManoloFLTK
256e368368 Wayland: account for memorised keyboard surface before wl_surface_destroy() 2023-04-17 08:19:59 +02:00
Albrecht Schlosser
4bc63da34d Fix compiler warnings [-Wpedantic]
Remove extra semicolons after function definitions
2023-04-13 20:27:00 +02:00
ManoloFLTK
4c567a4dd9 Fix "Giant cursor on Wayland + fractional scaling" (#713) 2023-04-08 06:50:56 +02:00
ManoloFLTK
c149091deb Wayland: fix reporting of relative location of multiple displays 2023-04-07 10:14:11 +02:00
ManoloFLTK
e790a3a185 Remove superfluous #include directives 2023-04-04 15:30:18 +02:00
ManoloFLTK
1d0e63ea78 Improve member function Fl_Wayland_Screen_Driver::surface_to_window()
Rename it to Fl_Wayland_Window_Driver::surface_to_window() and
avoid loop over all mapped FLTK windows that used to be performed.
2023-04-03 15:25:19 +02:00
ManoloFLTK
7e08bd7e26 Wayland + Weston: fix focus loss after click on titlebar 2023-04-03 08:21:07 +02:00