diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-12-01 14:43:32 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-12-02 09:28:08 +0100 |
| commit | f72748bb4563c07322846ae92cc9c02c0b448e5b (patch) | |
| tree | f1810fa604d181fc018249eb3fd0a0742650548d /src | |
| parent | 96730f80cbc3b2d5aec2967a61f16bb2f02853e6 (diff) | |
Wayland: make OPTION_USE_SYSTEM_LIBDECOR ON by default
This commit makes the default FLTK build setting use libdecor
as packaged in Linux when the build system contains packages
libdecor-0-dev and libdecor-0-plugin-1-gtk in version ≥ 0.2.0.
Otherwise, FLTK uses the bundled version of libdecor.
This includes situations where package libdecor-0-dev is
present in an earlier version.
Diffstat (limited to 'src')
| -rw-r--r-- | src/CMakeLists.txt | 25 | ||||
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx | 24 |
2 files changed, 11 insertions, 38 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a1d52f197..d6a7a047c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -521,10 +521,7 @@ if (OPTION_USE_WAYLAND) endif (DBUS_FOUND) if (OPTION_USE_SYSTEM_LIBDECOR) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_SYSTEM_LIBDECOR") - get_filename_component(PATH_TO_SHARED_LIBS ${HAVE_LIB_PANGO} DIRECTORY) - set (LIBDECOR_PLUGIN_DIR "\\\"${PATH_TO_SHARED_LIBS}/libdecor/plugins-1\\\" " ) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLIBDECOR_PLUGIN_DIR=${LIBDECOR_PLUGIN_DIR} ") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_SYSTEM_LIBDECOR") if (GTK_FOUND) set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_GTK") endif (GTK_FOUND) @@ -690,18 +687,18 @@ if (UNIX AND OPTION_USE_WAYLAND) ) list (APPEND STATIC_FILES "xdg-decoration-protocol.c") list (APPEND SHARED_FILES "xdg-decoration-protocol.c") - if (GTK_FOUND AND OPTION_ALLOW_GTK_PLUGIN) - add_custom_command( - OUTPUT gtk-shell-protocol.c gtk-shell-client-protocol.h - COMMAND wayland-scanner private-code ${CMAKE_CURRENT_SOURCE_DIR}/../libdecor/build/gtk-shell.xml gtk-shell-protocol.c - COMMAND wayland-scanner client-header ${CMAKE_CURRENT_SOURCE_DIR}/../libdecor/build/gtk-shell.xml gtk-shell-client-protocol.h - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../libdecor/build/gtk-shell.xml - VERBATIM - ) - list (APPEND STATIC_FILES "gtk-shell-protocol.c") - list (APPEND SHARED_FILES "gtk-shell-protocol.c") - endif (GTK_FOUND AND OPTION_ALLOW_GTK_PLUGIN) endif (NOT OPTION_USE_SYSTEM_LIBDECOR) + if (GTK_FOUND AND (OPTION_USE_SYSTEM_LIBDECOR OR OPTION_ALLOW_GTK_PLUGIN)) + add_custom_command( + OUTPUT gtk-shell-protocol.c gtk-shell-client-protocol.h + COMMAND wayland-scanner private-code ${CMAKE_CURRENT_SOURCE_DIR}/../libdecor/build/gtk-shell.xml gtk-shell-protocol.c + COMMAND wayland-scanner client-header ${CMAKE_CURRENT_SOURCE_DIR}/../libdecor/build/gtk-shell.xml gtk-shell-client-protocol.h + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../libdecor/build/gtk-shell.xml + VERBATIM + ) + list (APPEND STATIC_FILES "gtk-shell-protocol.c") + list (APPEND SHARED_FILES "gtk-shell-protocol.c") + endif (GTK_FOUND AND (OPTION_USE_SYSTEM_LIBDECOR OR OPTION_ALLOW_GTK_PLUGIN)) add_custom_command( OUTPUT text-input-protocol.c text-input-client-protocol.h COMMAND wayland-scanner private-code ${PROTOCOLS}/unstable/text-input/text-input-unstable-v3.xml text-input-protocol.c diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx index 83865878a..9082acf51 100644 --- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx @@ -1792,25 +1792,6 @@ int Fl_Wayland_Window_Driver::set_cursor_4args(const Fl_RGB_Image *rgb, int hotx } -#if defined(USE_SYSTEM_LIBDECOR) && USE_SYSTEM_LIBDECOR -// This is only to fix a bug in libdecor where what libdecor_frame_set_min_content_size() -// does is often destroyed by libdecor-cairo. -static void delayed_minsize(Fl_Window *win) { - struct wld_window *wl_win = fl_wl_xid(win); - Fl_Window_Driver *driver = Fl_Window_Driver::driver(win); - if (wl_win->kind == Fl_Wayland_Window_Driver::DECORATED) { - float f = Fl::screen_scale(win->screen_num()); - libdecor_frame_set_min_content_size(wl_win->frame, driver->minw()*f, driver->minh()*f); - } - bool need_resize = false; - int W = win->w(), H = win->h(); - if (W < driver->minw()) { W = driver->minw(); need_resize = true; } - if (H < driver->minh()) { H = driver->minh(); need_resize = true; } - if (need_resize) win->size(W, H); -} -#endif - - void Fl_Wayland_Window_Driver::resize(int X, int Y, int W, int H) { struct wld_window *fl_win = fl_wl_xid(pWindow); if (fl_win && fl_win->kind == DECORATED && !xdg_toplevel()) { @@ -1890,11 +1871,6 @@ void Fl_Wayland_Window_Driver::resize(int X, int Y, int W, int H) { xdg_surface_set_window_geometry(fl_win->xdg_surface, 0, 0, W, H); //printf("xdg_surface_set_window_geometry: %dx%d\n",W, H); } -#if defined(USE_SYSTEM_LIBDECOR) && USE_SYSTEM_LIBDECOR - if (W < minw() || H < minh()) { - Fl::add_timeout(0.01, (Fl_Timeout_Handler)delayed_minsize, pWindow); - } -#endif } else { if (!in_handle_configure && xdg_toplevel()) { // Wayland doesn't seem to provide a reliable way for the app to set the |
