From patchwork Sun Feb 19 15:44:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danny Milosavljevic X-Patchwork-Id: 47126 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 6A23516A3F; Sun, 19 Feb 2023 15:45:32 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5C5A316605 for ; Sun, 19 Feb 2023 15:45:30 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pTls9-0004Ev-AX; Sun, 19 Feb 2023 10:45:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTls7-0004Ef-9o for guix-patches@gnu.org; Sun, 19 Feb 2023 10:45:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pTls6-0003Fu-QR for guix-patches@gnu.org; Sun, 19 Feb 2023 10:45:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pTls6-0003Cb-FN for guix-patches@gnu.org; Sun, 19 Feb 2023 10:45:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61630] [PATCH] gnu: fluxbox: Make big cursors work. Resent-From: dannym@scratchpost.org Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 19 Feb 2023 15:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61630 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61630@debbugs.gnu.org Cc: Danny Milosavljevic X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167682147712243 (code B ref -1); Sun, 19 Feb 2023 15:45:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Feb 2023 15:44:37 +0000 Received: from localhost ([127.0.0.1]:49509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTlrg-0003BO-VD for submit@debbugs.gnu.org; Sun, 19 Feb 2023 10:44:37 -0500 Received: from lists.gnu.org ([209.51.188.17]:37512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTlre-0003BF-RV for submit@debbugs.gnu.org; Sun, 19 Feb 2023 10:44:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTlre-0004BI-FI for guix-patches@gnu.org; Sun, 19 Feb 2023 10:44:34 -0500 Received: from dd30410.kasserver.com ([85.13.145.193]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTlrc-0002tb-3H for guix-patches@gnu.org; Sun, 19 Feb 2023 10:44:34 -0500 Received: from a300.lan (84-115-230-178.cable.dynamic.surfer.at [84.115.230.178]) by dd30410.kasserver.com (Postfix) with ESMTPSA id 85F3C1120593; Sun, 19 Feb 2023 16:44:23 +0100 (CET) From: dannym@scratchpost.org Date: Sun, 19 Feb 2023 16:44:20 +0100 Message-Id: <20230219154420.6781-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Spamd-Bar: - Received-SPF: none client-ip=85.13.145.193; envelope-from=dannym@scratchpost.org; helo=dd30410.kasserver.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Danny Milosavljevic * gnu/packages/patches/fluxbox-1.3.7-no-dynamic-cursor.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/wm.scm (fluxbox)[source]: Add patch. [arguments]<#:phases>[force-bootstrap]: New phase. [native-inputs]: Add autoconf, automake, gnu-gettext. [inputs]: Add libxcursor. --- gnu/local.mk | 1 + .../fluxbox-1.3.7-no-dynamic-cursor.patch | 163 ++++++++++++++++++ gnu/packages/wm.scm | 11 +- 3 files changed, 173 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/fluxbox-1.3.7-no-dynamic-cursor.patch diff --git a/gnu/local.mk b/gnu/local.mk index f3d8dfcac6..e585a8be5e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1122,6 +1122,7 @@ dist_patch_DATA = \ %D%/packages/patches/flashrom-fix-building-on-aarch64.patch \ %D%/packages/patches/flatpak-fix-path.patch \ %D%/packages/patches/flatpak-unset-gdk-pixbuf-for-sandbox.patch \ + %D%/packages/patches/fluxbox-1.3.7-no-dynamic-cursor.patch \ %D%/packages/patches/fontconfig-cache-ignore-mtime.patch \ %D%/packages/patches/foobillard++-pkg-config.patch \ %D%/packages/patches/foomatic-filters-CVE-2015-8327.patch \ diff --git a/gnu/packages/patches/fluxbox-1.3.7-no-dynamic-cursor.patch b/gnu/packages/patches/fluxbox-1.3.7-no-dynamic-cursor.patch new file mode 100644 index 0000000000..8ac455833c --- /dev/null +++ b/gnu/packages/patches/fluxbox-1.3.7-no-dynamic-cursor.patch @@ -0,0 +1,163 @@ +From: Danny Milosavljevic +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 + #include ++#include ++#undef min ++#undef max ++#include + #include + + #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 +@@ -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) \ diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm index 5c391f5e1b..889ce08f1a 100644 --- a/gnu/packages/wm.scm +++ b/gnu/packages/wm.scm @@ -109,6 +109,7 @@ (define-module (gnu packages wm) #:use-module (gnu packages freedesktop) #:use-module (gnu packages fribidi) #:use-module (gnu packages gawk) + #:use-module (gnu packages gettext) #:use-module (gnu packages gl) #:use-module (gnu packages glib) #:use-module (gnu packages gperf) @@ -1045,12 +1046,17 @@ (define-public fluxbox version "/fluxbox-" version ".tar.xz")) (sha256 (base32 - "1h1f70y40qd225dqx937vzb4k2cz219agm1zvnjxakn5jkz7b37w")))) + "1h1f70y40qd225dqx937vzb4k2cz219agm1zvnjxakn5jkz7b37w")) + (patches + (search-patches "fluxbox-1.3.7-no-dynamic-cursor.patch")))) (build-system gnu-build-system) (arguments `(#:make-flags '("CPPFLAGS=-U__TIME__") ;ugly, but for reproducibility #:phases (modify-phases %standard-phases + (add-before 'bootstrap 'force-bootstrap + (lambda _ + (delete-file "configure"))) (add-after 'install 'install-vim-files (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -1073,12 +1079,13 @@ (define-public fluxbox Type=Application~%" ,name ,synopsis out))) #t)))))) (native-inputs - (list pkg-config)) + (list autoconf automake gnu-gettext pkg-config)) (inputs (list freetype fribidi imlib2 libx11 + libxcursor libxext libxft libxinerama