summaryrefslogtreecommitdiff
path: root/openbox/openbox-multihead.patch
diff options
context:
space:
mode:
authorMikhail Osipov <mike.osipov@gmail.com>2019-02-18 12:45:40 +0300
committerMikhail Osipov <mike.osipov@gmail.com>2019-02-18 12:45:40 +0300
commit6df32ad70a85b9094c4683a7cd867623f4ccbdee (patch)
tree152a5aaee15dd72f857b9ebb030071e460e3c44e /openbox/openbox-multihead.patch
parentf9460d1c8ab20b5ddb14b89a22ab27fd0885bc77 (diff)
openbox
Diffstat (limited to 'openbox/openbox-multihead.patch')
-rw-r--r--openbox/openbox-multihead.patch180
1 files changed, 180 insertions, 0 deletions
diff --git a/openbox/openbox-multihead.patch b/openbox/openbox-multihead.patch
new file mode 100644
index 0000000..e7a1a5d
--- /dev/null
+++ b/openbox/openbox-multihead.patch
@@ -0,0 +1,180 @@
+diff -ura openbox-3.6.1/openbox/client.c openbox-3.6.1-multihead/openbox/client.c
+--- openbox-3.6.1/openbox/client.c 2018-11-15 12:11:21.211662798 +0300
++++ openbox-3.6.1-multihead/openbox/client.c 2018-11-15 12:11:34.088329218 +0300
+@@ -324,8 +324,8 @@
+ (user_time != 0) &&
+ /* this checks for focus=false for the window */
+ settings->focus != 0 &&
+- focus_valid_target(self, self->desktop,
+- FALSE, FALSE, TRUE, TRUE, FALSE, FALSE,
++ focus_valid_target(self, self->desktop, 0,
++ FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE,
+ settings->focus == 1))
+ {
+ try_activate = TRUE;
+diff -ura openbox-3.6.1/openbox/client_list_combined_menu.c openbox-3.6.1-multihead/openbox/client_list_combined_menu.c
+--- openbox-3.6.1/openbox/client_list_combined_menu.c 2014-11-05 18:19:42.000000000 +0300
++++ openbox-3.6.1-multihead/openbox/client_list_combined_menu.c 2018-11-15 12:11:34.088329218 +0300
+@@ -58,9 +58,9 @@
+ menu_add_separator(menu, SEPARATOR, screen_desktop_names[desktop]);
+ for (it = focus_order; it; it = g_list_next(it)) {
+ ObClient *c = it->data;
+- if (focus_valid_target(c, desktop,
++ if (focus_valid_target(c, desktop, 0,
+ TRUE, TRUE,
+- FALSE, TRUE, FALSE, FALSE, FALSE))
++ FALSE, TRUE, FALSE, TRUE, FALSE, FALSE))
+ {
+ empty = FALSE;
+
+diff -ura openbox-3.6.1/openbox/client_list_menu.c openbox-3.6.1-multihead/openbox/client_list_menu.c
+--- openbox-3.6.1/openbox/client_list_menu.c 2014-11-05 18:19:42.000000000 +0300
++++ openbox-3.6.1-multihead/openbox/client_list_menu.c 2018-11-15 12:11:34.088329218 +0300
+@@ -54,8 +54,8 @@
+
+ for (it = focus_order; it; it = g_list_next(it)) {
+ ObClient *c = it->data;
+- if (focus_valid_target(c, d->desktop,
+- TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE)) {
++ if (focus_valid_target(c, d->desktop, 0,
++ TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE)) {
+ ObMenuEntry *e;
+
+ empty = FALSE;
+diff -ura openbox-3.6.1/openbox/focus.c openbox-3.6.1-multihead/openbox/focus.c
+--- openbox-3.6.1/openbox/focus.c 2014-11-05 18:19:42.000000000 +0300
++++ openbox-3.6.1-multihead/openbox/focus.c 2018-11-15 12:12:11.218328511 +0300
+@@ -136,8 +136,8 @@
+ 3. it is not shaded
+ */
+ if ((allow_omnipresent || c->desktop == screen_desktop) &&
+- focus_valid_target(c, screen_desktop,
+- TRUE, FALSE, FALSE, TRUE, FALSE, FALSE,
++ focus_valid_target(c, screen_desktop, 0,
++ TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE,
+ FALSE) &&
+ !c->shaded &&
+ (allow_refocus || client_focus_target(c) != old) &&
+@@ -158,8 +158,8 @@
+ a splashscreen or a desktop window (save the desktop as a
+ backup fallback though)
+ */
+- if (focus_valid_target(c, screen_desktop,
+- TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE) &&
++ if (focus_valid_target(c, screen_desktop, 0,
++ TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE) &&
+ (allow_refocus || client_focus_target(c) != old) &&
+ client_focus(c))
+ {
+@@ -291,8 +291,8 @@
+ ObClient *c = it->data;
+ /* check that it's not a helper window to avoid infinite recursion */
+ if (c != ft && c->type == OB_CLIENT_TYPE_NORMAL &&
+- focus_valid_target(c, screen_desktop,
+- TRUE, iconic_windows, all_desktops,
++ focus_valid_target(c, screen_desktop, 0,
++ TRUE, iconic_windows, all_desktops, TRUE,
+ TRUE, FALSE, FALSE, FALSE))
+ {
+ return TRUE;
+@@ -303,9 +303,11 @@
+
+ gboolean focus_valid_target(ObClient *ft,
+ guint desktop,
++ guint monitor,
+ gboolean helper_windows,
+ gboolean iconic_windows,
+ gboolean all_desktops,
++ gboolean all_monitors,
+ gboolean nonhilite_windows,
+ gboolean dock_windows,
+ gboolean desktop_windows,
+@@ -327,6 +329,8 @@
+ ok = (all_desktops || ft->desktop == desktop ||
+ ft->desktop == DESKTOP_ALL);
+
++ ok = ok && (all_monitors || client_monitor(ft) == monitor);
++
+ /* if we only include hilited windows, check if the window is */
+ ok = ok && (nonhilite_windows || ft->demands_attention);
+
+@@ -376,9 +380,11 @@
+ ObClient *cft = client_focus_target(ft);
+ ok = ok && (ft == cft || !focus_valid_target(cft,
+ screen_desktop,
++ monitor,
+ TRUE,
+ iconic_windows,
+ all_desktops,
++ all_monitors,
+ nonhilite_windows,
+ dock_windows,
+ desktop_windows,
+diff -ura openbox-3.6.1/openbox/focus_cycle.c openbox-3.6.1-multihead/openbox/focus_cycle.c
+--- openbox-3.6.1/openbox/focus_cycle.c 2014-11-05 18:19:42.000000000 +0300
++++ openbox-3.6.1-multihead/openbox/focus_cycle.c 2018-11-15 12:12:48.988327773 +0300
+@@ -40,9 +40,11 @@
+ static gboolean focus_cycle_linear;
+ static gboolean focus_cycle_iconic_windows;
+ static gboolean focus_cycle_all_desktops;
++static gboolean focus_cycle_all_monitors;
+ static gboolean focus_cycle_nonhilite_windows;
+ static gboolean focus_cycle_dock_windows;
+ static gboolean focus_cycle_desktop_windows;
++static guint focus_cycle_monitor;
+
+ static ObClient *focus_find_directional(ObClient *c,
+ ObDirection dir,
+@@ -109,6 +111,7 @@
+ GList *it, *start, *list;
+ ObClient *ft = NULL;
+ ObClient *ret = NULL;
++ guint monitor = 0;
+
+ if (cancel) {
+ focus_cycle_target = NULL;
+@@ -137,6 +140,9 @@
+ start = it = forward ? g_list_last(list) : g_list_first(list);
+ if (!start) goto done_cycle;
+
++ focus_cycle_monitor = client_monitor(it->data);
++ focus_cycle_all_monitors = FALSE;
++
+ do {
+ if (forward) {
+ it = it->next;
+@@ -163,6 +169,7 @@
+
+ focus_cycle_target = NULL;
+ focus_cycle_type = OB_CYCLE_NONE;
++ focus_cycle_all_monitors = TRUE;
+ g_list_free(order);
+ order = NULL;
+
+@@ -339,9 +346,10 @@
+
+ gboolean focus_cycle_valid(struct _ObClient *client)
+ {
+- return focus_valid_target(client, screen_desktop, TRUE,
++ return focus_valid_target(client, screen_desktop, focus_cycle_monitor, TRUE,
+ focus_cycle_iconic_windows,
+ focus_cycle_all_desktops,
++ focus_cycle_all_monitors,
+ focus_cycle_nonhilite_windows,
+ focus_cycle_dock_windows,
+ focus_cycle_desktop_windows,
+diff -ura openbox-3.6.1/openbox/focus.h openbox-3.6.1-multihead/openbox/focus.h
+--- openbox-3.6.1/openbox/focus.h 2014-11-05 18:19:42.000000000 +0300
++++ openbox-3.6.1-multihead/openbox/focus.h 2018-11-15 12:11:34.088329218 +0300
+@@ -70,9 +70,11 @@
+
+ gboolean focus_valid_target(struct _ObClient *ft,
+ guint desktop,
++ guint monitor,
+ gboolean helper_windows,
+ gboolean iconic_windows,
+ gboolean all_desktops,
++ gboolean all_monitors,
+ gboolean nonhilite_windows,
+ gboolean dock_windows,
+ gboolean desktop_windows,