aboutsummaryrefslogtreecommitdiff
From: Danny Milosavljevic <dannym@scratchpost.org>
Date: Sun, 19 Feb 2023 15:48:23 +0100
Subject: Make fluxbox use libxcursor directly

This patch makes fluxbox use libxcursor directly. This way, big cursors work.
Without it, libx11 would try to dlopen("libXcursor.so.1") and fail.

--- orig/fluxbox-1.3.7/configure.ac	2015-02-08 11:44:45.333187008 +0100
+++ fluxbox-1.3.7/configure.ac	2023-02-19 15:42:50.595886984 +0100
@@ -214,6 +214,18 @@
 CXXFLAGS="$X11_CFLAGS $CXXFLAGS"
 LIBS="$X11_LIBS $LIBS"
 
+dnl Check for Xcursor
+PKG_CHECK_MODULES([XCURSOR], [ xcursor ],
+        [AC_DEFINE([HAVE_XCURSOR], [1], [Define if xcursor is available]) have_cursor=yes],
+        [have_xcursor=no])
+AM_CONDITIONAL([XCURSOR], [test "$have_xcursor" = "yes"], AC_MSG_ERROR([Could not find XOpenDisplay in -lXcursor.]))
+AS_IF([test x$have_xcursor = "xno"], [
+        AC_MSG_ERROR([Fluxbox requires the Xcursor libraries and headers.])
+])
+
+CXXFLAGS="$XCURSOR_CFLAGS $CXXFLAGS"
+LIBS="$XCURSOR_LIBS $LIBS"
+
 dnl Check for xpg4
 AC_CHECK_LIB([xpg4], [setlocale], [LIBS="-lxpg4 $LIBS"])
 AC_CHECK_PROGS([gencat_cmd], [gencat])
diff -ru orig/fluxbox-1.3.7/src/FbWinFrameTheme.cc fluxbox-1.3.7/src/FbWinFrameTheme.cc
--- orig/fluxbox-1.3.7/src/FbWinFrameTheme.cc	2015-02-08 11:44:45.365187009 +0100
+++ fluxbox-1.3.7/src/FbWinFrameTheme.cc	2023-02-19 15:28:56.183284901 +0100
@@ -20,6 +20,7 @@
 // DEALINGS IN THE SOFTWARE.
 
 #include "FbWinFrameTheme.hh"
+#include "Xutil.hh"
 #include "IconbarTheme.hh"
 
 #include "FbTk/App.hh"
@@ -53,15 +54,15 @@
 
     // create cursors
     Display *disp = FbTk::App::instance()->display();
-    m_cursor_move = XCreateFontCursor(disp, XC_fleur);
-    m_cursor_lower_left_angle = XCreateFontCursor(disp, XC_bottom_left_corner);
-    m_cursor_lower_right_angle = XCreateFontCursor(disp, XC_bottom_right_corner);
-    m_cursor_upper_right_angle = XCreateFontCursor(disp, XC_top_right_corner);
-    m_cursor_upper_left_angle = XCreateFontCursor(disp, XC_top_left_corner);
-    m_cursor_left_side = XCreateFontCursor(disp, XC_left_side);
-    m_cursor_top_side = XCreateFontCursor(disp, XC_top_side);
-    m_cursor_right_side = XCreateFontCursor(disp, XC_right_side);
-    m_cursor_bottom_side = XCreateFontCursor(disp, XC_bottom_side);
+    m_cursor_move = Xutil::hidpiCreateFontCursor(disp, XC_fleur);
+    m_cursor_lower_left_angle = Xutil::hidpiCreateFontCursor(disp, XC_bottom_left_corner);
+    m_cursor_lower_right_angle = Xutil::hidpiCreateFontCursor(disp, XC_bottom_right_corner);
+    m_cursor_upper_right_angle = Xutil::hidpiCreateFontCursor(disp, XC_top_right_corner);
+    m_cursor_upper_left_angle = Xutil::hidpiCreateFontCursor(disp, XC_top_left_corner);
+    m_cursor_left_side = Xutil::hidpiCreateFontCursor(disp, XC_left_side);
+    m_cursor_top_side = Xutil::hidpiCreateFontCursor(disp, XC_top_side);
+    m_cursor_right_side = Xutil::hidpiCreateFontCursor(disp, XC_right_side);
+    m_cursor_bottom_side = Xutil::hidpiCreateFontCursor(disp, XC_bottom_side);
 
     FbTk::ThemeManager::instance().loadTheme(*this);
     reconfigTheme();
diff -ru orig/fluxbox-1.3.7/src/Screen.cc fluxbox-1.3.7/src/Screen.cc
--- orig/fluxbox-1.3.7/src/Screen.cc	2015-02-08 11:44:45.369187009 +0100
+++ fluxbox-1.3.7/src/Screen.cc	2023-02-19 15:28:23.783092203 +0100
@@ -53,6 +53,7 @@
 #include "SystemTray.hh"
 #endif
 #include "Debug.hh"
+#include "Xutil.hh"
 
 #include "FbTk/I18n.hh"
 #include "FbTk/FbWindow.hh"
@@ -306,7 +307,7 @@
     if (keys)
         keys->registerWindow(rootWindow().window(), *this,
                              Keys::GLOBAL|Keys::ON_DESKTOP);
-    rootWindow().setCursor(XCreateFontCursor(disp, XC_left_ptr));
+    rootWindow().setCursor(Xutil::hidpiCreateFontCursor(disp, XC_left_ptr));
 
     // load this screens resources
     fluxbox->load_rc(*this);
diff -ru orig/fluxbox-1.3.7/src/Xutil.cc fluxbox-1.3.7/src/Xutil.cc
--- orig/fluxbox-1.3.7/src/Xutil.cc	2015-02-08 11:44:45.377187009 +0100
+++ fluxbox-1.3.7/src/Xutil.cc	2023-02-19 15:47:29.009541689 +0100
@@ -28,6 +28,10 @@
 
 #include <X11/Xutil.h>
 #include <X11/Xatom.h>
+#include <X11/Xlibint.h>
+#undef min
+#undef max
+#include <X11/Xcursor/Xcursor.h>
 #include <iostream>
 
 #ifdef HAVE_CSTRING
@@ -133,5 +137,19 @@
     return class_name;
 }
 
+static XColor _Xconst foreground = { 0,    0,     0,     0  };  /* black */
+static XColor _Xconst background = { 0, 65535, 65535, 65535 };  /* white */
+Cursor hidpiCreateFontCursor(Display* dpy, unsigned int shape) {
+	if (dpy->cursor_font == None) {
+		dpy->cursor_font = XLoadFont(dpy, "cursor");
+		if (dpy->cursor_font == None) return None;
+	}
+
+	Cursor result = XcursorTryShapeCursor(dpy, dpy->cursor_font, dpy->cursor_font, (int) shape, (int) shape + 1, &foreground, &background);
+	if (!result)
+		result = XCreateFontCursor(dpy, (int) shape);
+	return result;
+}
+
 } // end namespace Xutil
 
diff -ru orig/fluxbox-1.3.7/src/Xutil.hh fluxbox-1.3.7/src/Xutil.hh
--- orig/fluxbox-1.3.7/src/Xutil.hh	2015-02-08 11:44:45.377187009 +0100
+++ fluxbox-1.3.7/src/Xutil.hh	2023-02-19 15:26:37.495619659 +0100
@@ -32,7 +32,7 @@
 
 FbTk::FbString getWMClassName(Window win);
 FbTk::FbString getWMClassClass(Window win);
-
+Cursor hidpiCreateFontCursor(Display* dpy, unsigned int shape);
 
 } // end namespace Xutil
 
diff -ru orig/fluxbox-1.3.7/util/fbrun/FbRun.cc fluxbox-1.3.7/util/fbrun/FbRun.cc
--- orig/fluxbox-1.3.7/util/fbrun/FbRun.cc	2015-02-08 11:44:45.377187009 +0100
+++ fluxbox-1.3.7/util/fbrun/FbRun.cc	2023-02-19 15:28:18.532468099 +0100
@@ -26,6 +26,7 @@
 #include "FbTk/Color.hh"
 #include "FbTk/KeyUtil.hh"
 #include "FbTk/FileUtil.hh"
+#include "Xutil.hh"
 
 #ifdef HAVE_XPM
 #include <X11/xpm.h>
@@ -67,7 +68,7 @@
     m_current_history_item(0),
     m_last_completion_prefix(""),
     m_current_apps_item(0),
-    m_cursor(XCreateFontCursor(FbTk::App::instance()->display(), XC_xterm)) {
+    m_cursor(Xutil::hidpiCreateFontCursor(FbTk::App::instance()->display(), XC_xterm)) {
 
     setGC(m_gc.gc());
     setCursor(m_cursor);
diff -ru orig/fluxbox-1.3.7/util/fbrun/Makemodule.am fluxbox-1.3.7/util/fbrun/Makemodule.am
--- orig/fluxbox-1.3.7/util/fbrun/Makemodule.am	2015-02-08 11:44:45.377187009 +0100
+++ fluxbox-1.3.7/util/fbrun/Makemodule.am	2023-02-19 15:50:33.029069099 +0100
@@ -8,7 +8,8 @@
 	util/fbrun/FbRun.hh \
 	util/fbrun/FbRun.cc \
 	util/fbrun/main.cc \
-	util/fbrun/fbrun.xpm
+	util/fbrun/fbrun.xpm \
+	src/Xutil.cc
 
 fbrun_LDADD = libFbTk.a \
 	$(FRIBIDI_LIBS) \
needed rules or databases, while also allowing users to supply a list of names to ignore (via regular expressions). * gnu/services/desktop.scm (gnome-desktop-configuration): Add udev-ignorelist. (gnome-udev-resources): Rename to… (gnome-udev-configuration-files): … this. Account for udev-ignorelist. (gnome-desktop-service-type): Adjust accordingly. Change-Id: I6df4b896652581c42a35ea3ba1e4849ad72d12ef Vivien Kraus 2024-02-23services: Modularise gnome-desktop-configuration....* gnu/services/gnome.scm (extract-propagated-inputs): New variable. (gnome-desktop-configuration): Add ‘core-services’, ‘shell’, ‘utilities’, and ‘extra-packages’. Deprecate ‘gnome’. (gnome-desktop-configuration-core-services, gnome-desktop-configuration-shell) (gnome-desktop-configuration-utilities) (gnome-desktop-configuration-extra-packages): Export publicly. (gnome-udev-rules, gnome-polkit-settings): Adjust accordingly. (gnome-profile): New variable. (gnome-desktop-service-type): Adjust accordingly. Liliana Marie Prikler 2023-08-17Merge remote-tracking branch 'origin/master' into kde-updates宋文武 2023-08-16gnu: elogind: Update to 252.9....* gnu/packages/freedesktop.scm (elogind): Update to 252.9. [source]: Replace elogind-revert-polkit-detection.patch with elogind-fix-rpath.patch in patches. [configure-flags]: Add the dbussystemservicedir, dbussessionservicedir, dbussystemservicedir and dbus-interfaces-dir flags. [phases] <use-global-hook-directory> Update list of patched files. <adjust-tests> Update substitutions, and skip the copy_holes test. [native-inputs]: Add python-jinja2. [inputs]: Add util-linux:lib. * gnu/services/desktop.scm (elogind-dbus-service) <elogind-dbus-service-wrapper>: Add a symlink to elogind's share/dbus-1/system.d to expose D-Bus policy configurations. * gnu/tests/desktop.scm (run-elogind-test): Adjust expected result for the new "linger" value. * gnu/packages/patches/elogind-revert-polkit-detection.patch: Delete file. * gnu/packages/patches/elogind-fix-rpath.patch: New file. * gnu/local.mk (dist_patch_DATA): Update. Series-to: 64938@debbugs.gnu.org Series-prefix: elogind-updates Series-version: 2 Series-changes: 2 - Fix elogind system test - Install D-Bus policy files in elogind-dbus-service-wrapper - Remove duplicate 'dbussystemservicedir' configure flag Maxim Cournoyer 2023-08-03services: Add Plasma desktop service....* gnu/services/desktop.scm (kde-desktop-service-type): New variable. (<kde-desktop-configuration>): New record type. (kde-desktop-configuration): New procedure. * doc/guix.texi (Desktop Services): Document it. Co-authored-by: Zheng Junjie <873216071@qq.com> Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Hartmut Goebel 2023-07-07gnu: gnome: Remove gnome-boxes from default GNOME apps....* gnu/packages/gnome.scm (gnome): Remove gnome-boxes from propagated-inputs, since it is no longer a Core App in 42. Josselin Poiret 2023-06-04services: screen-locker-service-type: Configurable PAM and setuid....screen-locker-service-type by default does both define PAM entry and make program setuid binary. Normally both methods are mutually exclusive, if binary has setuid set it does not really needs PAM, otherway around also similar, if PAM is enabled binary should not relay on setuid. Recent swaylock package now compiled with PAM support. When PAM support is compiled in, swaylock rejects executing if binary is also setuid program. This change turns screen-locker-configuration from strict PAM AND setuid to more flexible PAM AND/OR setuid. Allowing swaylock to be configured properly while supporting other screen locker preferences. * gnu/services/xorg.scm (screen-locker-configuration): Switch from define-record-type to define-configuration. [using-pam?]: New field to control PAM entry existence. [using-setuid?]: New field to control setuid binary existence. (screen-locker-pam-services): Should not make unix-pam-service if using-pam? is set to #f. (screen-locker-setuid-programs): Should not make program setuid program if using-setuid? is set to #f. (screen-locker-generate-doc): Internal function to generate configuration documentation. (screen-locker-service): Adapt to new screen-locker-configuration. * gnu/services/desktop.scm (desktop-services-for-system): Adapt to new screen-locker-configuration. * doc/guix.texi: Reflect new changes to screen-locker-configuration. Signed-off-by: Josselin Poiret <dev@jpoiret.xyz> muradm 2023-05-11services: elogind: Add elogind as a shepherd PAM requirement....* gnu/services/desktop.scm (pam-extension-procedure): Add the elogind shepherd requirement to the PAM extension. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Josselin Poiret 2023-05-11system: pam: Let PAM extensions add shepherd requirements....* gnu/system/pam.scm (<pam-extension>): New record type. (pam-shepherd-service): Add Shepherd synchronization point. * gnu/services/mail.scm (dovecot-shepherd-service) * gnu/services/lightdm.scm (lightdm-shepherd-service) * gnu/services/mail.scm (opensmtpd-shepherd-service) * gnu/services/sddm.scm (sddm-shepherd-service) * gnu/services/ssh.scm (lsh-shepherd-service, openssh-shepherd-service) * gnu/services/xorg.scm (slim-shepherd-service, gdm-shepherd-service) * gnu/services/base.scm (greetd-shepherd-services): Add PAM requirement. * gnu/system/pam.scm (/etc-entry, extend-configuration, pam-root-service-type, pam-root-service) * gnu/services/authentication.scm (pam-ldap-pam-service) * gnu/services/base.scm (pam-limits-service-type) (greetd-pam-service) * gnu/services/desktop.scm (pam-gnome-keyring) * gnu/services/kerberos.scm (pam-krb5-pam-service) * gnu/services/pam-mount.scm (pam-mount-pam-service): Adapt to use pam-extension. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Josselin Poiret 2023-04-07services: desktop: Remove 'xfce-desktop-service' procedure....* gnu/services/desktop.scm (xfce-desktop-service): Remove procedure. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Bruno Victal 2023-04-07services: desktop: Remove 'mate-desktop-service' procedure....* gnu/services/desktop.scm (mate-desktop-service): Remove procedure. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Bruno Victal 2023-04-07services: desktop: Remove 'gnome-desktop-service' procedure....* gnu/services/desktop.scm (gnome-desktop-service): Remove procedure. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Bruno Victal