summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-08-26 09:38:57 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-08-26 09:38:57 +0200
commit13f1911624359e8370c070981bb4b391b3caaae1 (patch)
tree86825cac0d626e7d59e6a591ed3bc9994ba5867f
parent6d04ef2caa1d78ffb388b5ef13f7df0ebbaf9f39 (diff)
Implement and document Fl::add_system_handler() for Wayland
-rw-r--r--src/Fl.cxx2
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx
index 83d1b9de1..dc35d5195 100644
--- a/src/Fl.cxx
+++ b/src/Fl.cxx
@@ -960,7 +960,7 @@ static system_handler_link *sys_handlers = 0;
- X11: XEvent
- Windows: MSG
- OS X: NSEvent
- - Wayland: not implemented
+ - Wayland: NULL (FLTK runs the event handler(s) just before calling \e wl_display_dispatch())
\param ha The event handler function to register
\param data User data to include on each call
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
index 7a376efb4..01fd46536 100644
--- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
@@ -1335,7 +1335,11 @@ static const struct wl_registry_listener registry_listener = {
};
+extern int fl_send_system_handlers(void *);
+
+
static void wayland_socket_callback(int fd, struct wl_display *display) {
+ if (fl_send_system_handlers(NULL)) return;
struct pollfd fds = (struct pollfd) { fd, POLLIN, 0 };
do {
if (wl_display_dispatch(display) == -1) {