summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVlad Glagolev2018-08-25 22:43:04 -0700
committerVlad Glagolev2018-08-25 22:43:04 -0700
commitd36ce51679fb0d649e16e4ee8342a50dd16dbd09 (patch)
tree6616fdb87b7c63053edc195d5f3f97a1e0949c3c
parenta0c7afdc72bd232c3fbcbe83a31179806b31f673 (diff)
jgmenu: => 1.2.1
-rwxr-xr-xwm-addons/jgmenu/CONFIGURE6
-rwxr-xr-xwm-addons/jgmenu/DEPENDS8
-rwxr-xr-xwm-addons/jgmenu/DETAILS4
-rw-r--r--wm-addons/jgmenu/HISTORY5
-rw-r--r--wm-addons/jgmenu/at-pointer.patch104
-rw-r--r--wm-addons/jgmenu/single_window.patch118
-rw-r--r--wm-addons/jgmenu/xrandr.patch150
7 files changed, 11 insertions, 384 deletions
diff --git a/wm-addons/jgmenu/CONFIGURE b/wm-addons/jgmenu/CONFIGURE
index 13a78b1465..5faeb06168 100755
--- a/wm-addons/jgmenu/CONFIGURE
+++ b/wm-addons/jgmenu/CONFIGURE
@@ -1,3 +1,3 @@
-config_query JGMENU_SINGLE_WINDOW "Re-enable single window mode option?" n &&
-
-config_query JGMENU_XRANDR "Use modern Xrandr extension instead of Xinerama?" n
+# remove obsolete options
+persistent_remove JGMENU_SINGLE_WINDOW &&
+persistent_remove JGMENU_XRANDR
diff --git a/wm-addons/jgmenu/DEPENDS b/wm-addons/jgmenu/DEPENDS
index 0f50a37421..10f639b538 100755
--- a/wm-addons/jgmenu/DEPENDS
+++ b/wm-addons/jgmenu/DEPENDS
@@ -1,12 +1,6 @@
depends libpng &&
depends libx11 &&
-
-if [ ${JGMENU_XRANDR} == y ]; then
- depends libxrandr
-else
- depends libxinerama
-fi &&
-
+depends libxrandr &&
depends pango &&
depends cairo &&
depends librsvg2 &&
diff --git a/wm-addons/jgmenu/DETAILS b/wm-addons/jgmenu/DETAILS
index 71748f0578..c3ad7049d8 100755
--- a/wm-addons/jgmenu/DETAILS
+++ b/wm-addons/jgmenu/DETAILS
@@ -1,8 +1,8 @@
SPELL=jgmenu
- VERSION=0.8.2
+ VERSION=1.2.1
SOURCE=${SPELL}-${VERSION}.tar.gz
SOURCE_URL[0]=https://github.com/johanmalm/${SPELL}/archive/v${VERSION}.tar.gz
- SOURCE_HASH=sha512:abd7e5503cb41cf19178cfc2d98e445e945fab613a37696057e092966670aca7afb285b1674fe4fbc665630622052602b77c87df59f96a9547465116e7163810
+ SOURCE_HASH=sha512:404fbdf75a218d97ed10fce2abbadaafc7e158153f7d85504d1ab2d1c7984e38c3d41324fe530b0d86881002b94424f0505cb43bd7bcf1397934decd463c62eb
SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-${VERSION}"
DOC_DIRS="docs/relnotes"
DOCS="docs/manual/*.md ${DOCS}"
diff --git a/wm-addons/jgmenu/HISTORY b/wm-addons/jgmenu/HISTORY
index ede90b5ec4..8644e99c67 100644
--- a/wm-addons/jgmenu/HISTORY
+++ b/wm-addons/jgmenu/HISTORY
@@ -1,3 +1,8 @@
+2018-08-25 Vlad Glagolev <stealth@sourcemage.org>
+ * DETAILS: updated spell to 1.2.1
+ * PRE_BUILD: removed
+ * *.patch: removed, fixed by upstream
+
2018-08-11 Vlad Glagolev <stealth@sourcemage.org>
* CONFIGURE, DEPENDS: added xrandr option
* PRE_BUILD: apply patches
diff --git a/wm-addons/jgmenu/at-pointer.patch b/wm-addons/jgmenu/at-pointer.patch
deleted file mode 100644
index aed6c7f5a1..0000000000
--- a/wm-addons/jgmenu/at-pointer.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-From 1e0bae4e0bacbb0570ac2181055ce628748d35ee Mon Sep 17 00:00:00 2001
-From: Johan Malm <jgm323@gmail.com>
-Date: Thu, 17 May 2018 18:28:36 +0100
-Subject: [PATCH] multi-monitor: launch correctly 'at-pointer' (issue #56)
-
-Update screen dimensions before launching when in at_pointer mode in
-order to use the correct x0, y0, width and height.
----
- geometry.c | 12 ++++++++----
- geometry.h | 1 +
- jgmenu.c | 1 +
- x11-ui.c | 15 +++++++++++++++
- 4 files changed, 25 insertions(+), 4 deletions(-)
-
-diff --git a/geometry.c b/geometry.c
-index 55aa737..541ac2e 100644
---- a/geometry.c
-+++ b/geometry.c
-@@ -133,6 +133,13 @@ static void geo_update(void)
- update_sub_window();
- }
-
-+void geo_update_monitor_coords(void)
-+{
-+ ui_get_screen_res(&screen_x0, &screen_y0, &screen_width,
-+ &screen_height, config.monitor);
-+ geo_update();
-+}
-+
- void geo_init(void)
- {
- /*
-@@ -155,10 +162,7 @@ void geo_init(void)
- item_margin_x = 4;
- item_margin_y = 4;
-
-- ui_get_screen_res(&screen_x0, &screen_y0, &screen_width,
-- &screen_height, config.monitor);
--
-- geo_update();
-+ geo_update_monitor_coords();
- }
-
- int geo_get_item_coordinates(struct area *a)
-diff --git a/geometry.h b/geometry.h
-index f0647f9..ce57adf 100644
---- a/geometry.h
-+++ b/geometry.h
-@@ -47,6 +47,7 @@
- #include "x11-ui.h"
- #include "align.h"
-
-+void geo_update_monitor_coords(void);
- void geo_init(void);
- int geo_get_item_coordinates(struct area *a);
- struct point geo_get_max_itemarea_that_fits(void);
-diff --git a/jgmenu.c b/jgmenu.c
-index 7b75cec..9b41ea4 100644
---- a/jgmenu.c
-+++ b/jgmenu.c
-@@ -809,6 +809,7 @@ void launch_menu_at_pointer(void)
- struct point pos;
- struct area wa;
-
-+ geo_update_monitor_coords();
- XQueryPointer(ui->dpy, DefaultRootWindow(ui->dpy), &dw, &dw, &di, &di,
- &pos.x, &pos.y, &du);
-
-diff --git a/x11-ui.c b/x11-ui.c
-index edc6bde..3404f84 100644
---- a/x11-ui.c
-+++ b/x11-ui.c
-@@ -131,6 +131,17 @@ void ui_init(void)
- ui->root = RootWindow(ui->dpy, ui->screen);
- }
-
-+static void print_screen_info(int n, XineramaScreenInfo *screen_info)
-+{
-+ int i;
-+
-+ info("%d monitor(s) detected", n);
-+ for (i = 0; i < n; i++)
-+ printf(" - monitor-%d: x0=%d; y0=%d; w=%d; h=%d\n",
-+ i + 1, screen_info[i].x_org, screen_info[i].y_org,
-+ screen_info[i].width, screen_info[i].height);
-+}
-+
- #define INTERSECT(x, y, w, h, r) (MAX(0, MIN((x) + (w), (r).x_org + (r).width) - \
- MAX((x), (r).x_org)) &&\
- MAX(0, MIN((y) + (h), (r).y_org + (r).height) - \
-@@ -146,9 +157,13 @@ void ui_get_screen_res(int *x0, int *y0, int *width, int *height, int monitor)
- screen_info = XineramaQueryScreens(ui->dpy, &n);
- BUG_ON(!screen_info);
- XQueryPointer(ui->dpy, ui->root, &dw, &dw, &x, &y, &di, &di, &du);
-+ if (getenv("JGMENU_SCREEN_INFO"))
-+ print_screen_info(n, screen_info);
- for (i = 0; i < n; i++)
- if (INTERSECT(x, y, 1, 1, screen_info[i]))
- break;
-+
-+ /* handle user specified monitor (from config file) */
- if (monitor) {
- if (monitor > n)
- die("cannot connect to monitor '%d' (max %d)", monitor, n);
diff --git a/wm-addons/jgmenu/single_window.patch b/wm-addons/jgmenu/single_window.patch
deleted file mode 100644
index d241441d7f..0000000000
--- a/wm-addons/jgmenu/single_window.patch
+++ /dev/null
@@ -1,118 +0,0 @@
---- b/config.c
-+++ a/config.c
-@@ -110,6 +110,8 @@
- xatoi(&config.tint2_look, value, XATOI_NONNEG, "config.tint2_look");
- } else if (!strcmp(option, "at_pointer")) {
- xatoi(&config.at_pointer, value, XATOI_NONNEG, "config.at_pointer");
-+ } else if (!strcmp(option, "multi_window")) {
-+ xatoi(&config.multi_window, value, XATOI_NONNEG, "config.multi_window");
- } else if (!strcmp(option, "terminal_exec")) {
- xfree(config.terminal_exec);
- config.terminal_exec = xstrdup(value);
-reverted:
---- b/docs/jgmenurc
-+++ a/docs/jgmenurc
-@@ -7,6 +7,7 @@
- #csv_cmd = pmenu
- #tint2_look = 1
- #at_pointer = 0
-+#multi_window = 1
- #terminal_exec = x-terminal-emulator
- #terminal_args = -e
- #monitor = 0
-reverted:
---- b/docs/manual/jgmenu.1
-+++ a/docs/manual/jgmenu.1
-@@ -1,6 +1,6 @@
- .\" Automatically generated by Pandoc 2.0.6
- .\"
-+.TH "JGMENU" "1" "29 January, 2017" "" ""
--.TH "JGMENU" "1" "17 February, 2017" "" ""
- .hy
- .SH NAME
- .PP
-@@ -454,6 +454,10 @@
- .PD
- \ \ \ \ ignoring \f[C]menu_margin_?\f[] and \f[C]menu_?align\f[] values.
- .PP
-+multi_window = \f[B]boolean\f[] (default 1)
-+.PP
-+\ \ \ \ If enabled, submenus open in new windows.
-+.PP
- terminal_exec = \f[B]string\f[] (default x\-terminal\-emulator)
- .PD 0
- .P
-reverted:
---- b/docs/manual/jgmenu.1.md
-+++ a/docs/manual/jgmenu.1.md
-@@ -1,6 +1,6 @@
- % JGMENU(1)
- % Johan Malm
-+% 29 January, 2017
--% 17 February, 2017
-
- # NAME
-
-@@ -215,6 +215,10 @@
-     If enabled, the menu is launched at the pointer position,
-     ignoring `menu_margin_?` and `menu_?align` values.
-
-+multi_window = __boolean__ (default 1)
-+
-+    If enabled, submenus open in new windows.
-+
- terminal_exec = __string__ (default x-terminal-emulator)
- terminal_args = __string__ (default -e)
-
-reverted:
---- b/examples/ex01/jgmenurc
-+++ a/examples/ex01/jgmenurc
-@@ -8,3 +8,4 @@
- color_norm_fg = #111111 100
- color_sel_bg = #2222dd 80
- color_sel_fg = #eeeeee 100
-+multi_window = 1
-reverted:
---- b/examples/ex02/jgmenurc
-+++ a/examples/ex02/jgmenurc
-@@ -1,5 +1,7 @@
- # .jgmenurc example
-
-+multi_window = 0
-+
- menu_margin_x = 10
- menu_margin_y = 40
- menu_width = 250
-reverted:
---- b/examples/ex03/jgmenurc
-+++ a/examples/ex03/jgmenurc
-@@ -1,6 +1,7 @@
- # .jgmenurc example
-
- at_pointer = 1
-+multi_window = 1
-
- menu_margin_x = 10
- menu_margin_y = 40
-reverted:
---- b/examples/ex13/jgmenurc
-+++ a/examples/ex13/jgmenurc
-@@ -7,6 +7,7 @@
- #csv_cmd = pmenu
- tint2_look = 0
- #at_pointer = 0
-+multi_window = 1
- #terminal_exec = x-terminal-emulator
- #terminal_args = -e
- #
-reverted:
---- b/jgmenu-init.sh
-+++ a/jgmenu-init.sh
-@@ -27,6 +27,7 @@
- csv_cmd = pmenu
- tint2_look = 1
- at_pointer = 0
-+multi_window = 1
- terminal_exec = x-terminal-emulator
- terminal_args = -e
- monitor = 0
diff --git a/wm-addons/jgmenu/xrandr.patch b/wm-addons/jgmenu/xrandr.patch
deleted file mode 100644
index 71047a30a8..0000000000
--- a/wm-addons/jgmenu/xrandr.patch
+++ /dev/null
@@ -1,150 +0,0 @@
-From f8ccef404fe8436e4473e48cfa66d8389286e234 Mon Sep 17 00:00:00 2001
-From: Johan Malm <jgm323@gmail.com>
-Date: Sat, 11 Aug 2018 13:45:35 +0100
-Subject: [PATCH] x11-ui.c: replace xinerama with xrandr (issue #60)
-
-xinerama has been reported to segfault with some new graphics cards.
-
-Suggested-by: @vaygr
----
- Makefile.inc | 2 +-
- x11-ui.c | 91 +++++++++++++++++++++++++++++++++++-----------------
- 2 files changed, 63 insertions(+), 30 deletions(-)
-
-diff --git a/Makefile.inc b/Makefile.inc
-index b33b399..9f362c8 100644
---- a/Makefile.inc
-+++ b/Makefile.inc
-@@ -23,7 +23,7 @@ jgmenu-ob: CFLAGS += `xml2-config --cflags`
- jgmenu-xdg: CFLAGS += `xml2-config --cflags`
- jgmenu-lx: CFLAGS += `pkg-config --cflags glib-2.0 libmenu-cache`
-
--jgmenu: LIBS += `pkg-config x11 xinerama cairo pango pangocairo librsvg-2.0 --libs`
-+jgmenu: LIBS += `pkg-config x11 xrandr cairo pango pangocairo librsvg-2.0 --libs`
- jgmenu: LIBS += -pthread -lrt -lpng
- jgmenu-ob: LIBS += `xml2-config --libs`
- jgmenu-xdg: LIBS += `xml2-config --libs`
-diff --git a/x11-ui.c b/x11-ui.c
-index 7ed7678..e6df14d 100644
---- a/x11-ui.c
-+++ b/x11-ui.c
-@@ -16,7 +16,7 @@
- #include <X11/Xlib.h>
- #include <X11/Xatom.h>
- #include <X11/Xutil.h>
--#include <X11/extensions/Xinerama.h>
-+#include <X11/extensions/Xrandr.h>
- #include <unistd.h> /* for usleep */
-
- #include "x11-ui.h"
-@@ -131,49 +131,82 @@ void ui_init(void)
- ui->root = RootWindow(ui->dpy, ui->screen);
- }
-
--static void print_screen_info(int n, XineramaScreenInfo *screen_info)
-+static void print_screen_info(void)
- {
-- int i;
--
-- info("%d monitor(s) detected", n);
-- for (i = 0; i < n; i++)
-- printf(" - monitor-%d: x0=%d; y0=%d; w=%d; h=%d\n",
-- i + 1, screen_info[i].x_org, screen_info[i].y_org,
-- screen_info[i].width, screen_info[i].height);
-+ int i, n;
-+ XRRScreenResources *sr;
-+ XRRCrtcInfo *ci = NULL;
-+
-+ sr = XRRGetScreenResources(ui->dpy, DefaultRootWindow(ui->dpy));
-+ n = sr->noutput;
-+ info("%d xrandr outputs(s) detected", n);
-+ for (i = 0; i < n; i++) {
-+ ci = XRRGetCrtcInfo(ui->dpy, sr, sr->crtcs[i]);
-+ if (!ci->width || !ci->height)
-+ printf(" - monitor-%d: not connected\n", i + 1);
-+ else
-+ printf(" - monitor-%d: x0=%d; y0=%d; w=%d; h=%d\n",
-+ i + 1, ci->x, ci->y, ci->width, ci->height);
-+ }
-+ XRRFreeCrtcInfo(ci);
-+ XRRFreeScreenResources(sr);
- }
-
--#define INTERSECT(x, y, w, h, r) (MAX(0, MIN((x) + (w), (r).x_org + (r).width) - \
-- MAX((x), (r).x_org)) &&\
-- MAX(0, MIN((y) + (h), (r).y_org + (r).height) - \
-- MAX((y), (r).y_org)))
-+static int intersect(int x, int y, int w, int h, XRRCrtcInfo *ci)
-+{
-+ return MAX(0, MIN(x + w, (int)ci->x + (int)ci->width) - MAX(x, (int)ci->x)) &&
-+ MAX(0, MIN(y + h, (int)ci->y + (int)ci->height) - MAX(y, (int)ci->y));
-+}
-
- void ui_get_screen_res(int *x0, int *y0, int *width, int *height, int monitor)
- {
- int i, n, x, y, di;
- unsigned int du;
- Window dw;
-- XineramaScreenInfo *screen_info;
-+ XRRScreenResources *sr;
-+ XRRCrtcInfo *ci = NULL;
-
-- screen_info = XineramaQueryScreens(ui->dpy, &n);
-- BUG_ON(!screen_info);
-- XQueryPointer(ui->dpy, ui->root, &dw, &dw, &x, &y, &di, &di, &du);
- if (getenv("JGMENU_SCREEN_INFO"))
-- print_screen_info(n, screen_info);
-- for (i = 0; i < n; i++)
-- if (INTERSECT(x, y, 1, 1, screen_info[i]))
-- break;
-+ print_screen_info();
-+ sr = XRRGetScreenResources(ui->dpy, DefaultRootWindow(ui->dpy));
-+ BUG_ON(!sr);
-+ n = sr->noutput;
-
-- /* handle user specified monitor (from config file) */
-+ /*
-+ * Global variable config.monitor let's the user specify a monitor.
-+ * If not set, we use the current pointer position
-+ */
- if (monitor) {
- if (monitor > n)
-- die("cannot connect to monitor '%d' (max %d)", monitor, n);
-- i = monitor - 1;
-+ die("cannot connect to monitor '%d'", monitor);
-+ ci = XRRGetCrtcInfo(ui->dpy, sr, sr->crtcs[monitor - 1]);
-+ if (!ci->width || !ci->height)
-+ die("cannot connect to monitor '%d'", monitor);
-+ info("using user specified monitor '%d'", monitor);
-+ goto monitor_selected;
-+ }
-+
-+ XQueryPointer(ui->dpy, ui->root, &dw, &dw, &x, &y, &di, &di, &du);
-+ for (i = 0; i < n; i++) {
-+ ci = XRRGetCrtcInfo(ui->dpy, sr, sr->crtcs[i]);
-+ BUG_ON(!ci);
-+ if (!ci->width || !ci->height)
-+ continue;
-+ if (intersect(x, y, 1, 1, ci)) {
-+ info("using monitor '%d'", i + 1);
-+ break;
-+ }
- }
-- *x0 = screen_info[i].x_org;
-- *y0 = screen_info[i].y_org;
-- *width = screen_info[i].width;
-- *height = screen_info[i].height;
-- XFree(screen_info);
-+
-+monitor_selected:
-+ if (!ci)
-+ die("connection could be established to monitor");
-+ *x0 = ci->x;
-+ *y0 = ci->y;
-+ *width = ci->width;
-+ *height = ci->height;
-+ XRRFreeCrtcInfo(ci);
-+ XRRFreeScreenResources(sr);
- }
-
- void set_wm_class(void)