Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package i3-gaps for openSUSE:Factory checked 
in at 2022-12-25 15:14:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/i3-gaps (Old)
 and      /work/SRC/openSUSE:Factory/.i3-gaps.new.1563 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "i3-gaps"

Sun Dec 25 15:14:59 2022 rev:17 rq:1045240 version:4.21.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/i3-gaps/i3-gaps.changes  2022-09-22 
14:50:32.578530328 +0200
+++ /work/SRC/openSUSE:Factory/.i3-gaps.new.1563/i3-gaps.changes        
2022-12-25 15:15:22.257548999 +0100
@@ -1,0 +2,18 @@
+Tue Dec  6 21:13:46 UTC 2022 - Dirk Müller <dmuel...@suse.com>
+
+- update to 4.21.1:
+  * tiling drag: allow configuration
+  * tiling drag: allow click immediately, to focus on decoration click
+  * tiling drag: fix cursor (wrong argument passed)
+  * tiling drag: increase drag threshold, run it through logical_px
+  * tiling drag: left-click needs threshold, mod-click doesn’t
+  * tiling drag: ignore scratchpad windows when locating drop targets
+  * tiling drag: only start when there are drop targets
+  * Raise floating windows when their border is clicked
+  * docs/ipc: document sticky field of GET_TREE
+  * man/i3-config-wizard: escape ~ to prevent interpretation as subscript
+  * Motif hints: respect maximum border style configuration set by user
+  * i3-dmenu-desktop: fix quoting bug
+  * Fix segfault during config validation
+
+-------------------------------------------------------------------

Old:
----
  i3-gaps-4.21.tar.xz

New:
----
  i3-gaps-4.21.1.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ i3-gaps.spec ++++++
--- /var/tmp/diff_new_pack.qUXVfT/_old  2022-12-25 15:15:22.945552894 +0100
+++ /var/tmp/diff_new_pack.qUXVfT/_new  2022-12-25 15:15:22.953552939 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           i3-gaps
-Version:        4.21
+Version:        4.21.1
 Release:        0
 Summary:        Tiling window manager
 License:        BSD-3-Clause

++++++ i3-gaps-4.21.tar.xz -> i3-gaps-4.21.1.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/RELEASE-NOTES-4.21 
new/i3-4.21.1/RELEASE-NOTES-4.21
--- old/i3-4.21/RELEASE-NOTES-4.21      2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/RELEASE-NOTES-4.21    1970-01-01 01:00:00.000000000 +0100
@@ -1,74 +0,0 @@
-
- 
┌──────────────────────────────┐
- │ Release notes for i3 v4.21   │
- 
└──────────────────────────────┘
-
-This is i3 v4.21. This version is considered stable. All users of i3 are
-strongly encouraged to upgrade.
-
-The biggest change in this release is that you can now drag tiling windows
-with your mouse (floating windows could already be dragged). For more details
-on how to use this feature, please refer to the userguide:
-
-https://i3wm.org/docs/userguide.html#_moving_tiling_containers_with_the_mouse
-
-A big thank you goes out to our core i3 developer Orestis Floros who made this
-feature possible, based on previous work from Michael Forster and Tony Crisci!
-
- 
┌────────────────────────────┐
- │ Changes in i3 v4.21        │
- 
└────────────────────────────┘
-
-  • Allow dragging tiling windows with the mouse
-  • Add client.focused_tab_title color option
-  • Add support for multiple output names in the focus command,
-    allowing users to cycle focus between e.g. VGA1 and LVDS1 but not DVI0.
-  • Add a toggle option to the title_window_icon command
-  • i3 switched from the obsolete PCRE 8.x regular expression matching
-    library to the current PCRE2 10.x version.
-
- 
┌────────────────────────────┐
- │ Bugfixes                   │
- 
└────────────────────────────┘
-
-  • docs/ipc: document all window_type values
-  • docs/userguide: clarify the difference between the “workspace N” and
-    “workspace number N” commands
-  • i3bar: fix default font not being applied to bars if defined after bar 
block
-  • i3-dmenu-desktop: add backslashes for the exec command,
-    which fixes opening some .desktop files (e.g. electrum)
-  • i3-sensible-pager: sanitize LESS environment variable to remove -E or -F
-  • testsuite: catch i3 crashes instead of hanging on crash
-  • Fix logging on machines with 256 GB of RAM
-  • Do not replace existing IPC socket on start, to prevent clobbering
-    the IPC socket when running i3 within i3 (e.g. in Xepyhr, for development)
-  • Refuse to start without a valid IPC socket
-  • Fix focus when moving container between outputs with mouse warp and
-    focus_follows_mouse
-  • Fix endless loop with transient_for windows
-  • Fix wrong “failed” IPC reply on move workspace to output
-  • Fix WM registration selection (from WM_S_S<screen> to WM_S<screen>)
-  • avoid graphics artifacts when changing the layout tree by
-    initializing surfaces to all black
-  • update parent split con titles when child container swaps position with
-    another child container
-  • Fix segfault if command in bindsym is empty
-  • Fix segfault with explicit mode "default" key bindings
-  • Fix crash if config contains nested variables.
-  • strip trailing whitespace in bar output names
-  • Fix crash with long commands
-  • Fix changing borders by restoring BS_NORMAL _MOTIF_WM_HINTS correctly
-
- 
┌────────────────────────────┐
- │ Thanks!                    │
- 
└────────────────────────────┘
-
-Thanks for testing, bugfixes, discussions and everything I forgot go out to:
-
-André Silva, Anton Älgmyr, Baptiste Daroussin, bodea, Chris Templin, George
-Rodrigues, Gergely Risko, Ingo Bürk, Jakob Haufe, Jay Ta'ala, Jeff Smith, 
Jonta,
-Josh Soref, Kjetil Torgrim Homme, lycurgus, mariano, Michael Forster, Orestis
-Floros, paperluigis, Peder Stray, rvalieris, sergio, Tony Crisci, takelley1, 
Uli
-Schlachter, viri, zhiv-git, zhrvn
-
--- Michael Stapelberg, 2021-10-19
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/RELEASE-NOTES-4.21.1 
new/i3-4.21.1/RELEASE-NOTES-4.21.1
--- old/i3-4.21/RELEASE-NOTES-4.21.1    1970-01-01 01:00:00.000000000 +0100
+++ new/i3-4.21.1/RELEASE-NOTES-4.21.1  2022-10-28 13:46:28.000000000 +0200
@@ -0,0 +1,44 @@
+
+ 
┌──────────────────────────────┐
+ │ Release notes for i3 v4.21.1 │
+ 
└──────────────────────────────┘
+
+This is i3 v4.21.1. This version is considered stable. All users of i3 are
+strongly encouraged to upgrade.
+
+This release fixes a few rough edges with regards to the newly-introduced
+tiling drag feature, which is now configurable:
+https://i3wm.org/docs/userguide.html#config_tiling_drag
+
+ 
┌────────────────────────────┐
+ │ Changes in i3 v4.21.1      │
+ 
└────────────────────────────┘
+
+  • tiling drag: allow configuration
+  • tiling drag: allow click immediately, to focus on decoration click
+  • tiling drag: fix cursor (wrong argument passed)
+  • tiling drag: increase drag threshold, run it through logical_px
+  • tiling drag: left-click needs threshold, mod-click doesn’t
+  • tiling drag: ignore scratchpad windows when locating drop targets
+  • tiling drag: only start when there are drop targets
+  • Raise floating windows when their border is clicked
+
+ 
┌────────────────────────────┐
+ │ Bugfixes                   │
+ 
└────────────────────────────┘
+
+  • docs/ipc: document sticky field of GET_TREE
+  • man/i3-config-wizard: escape ~ to prevent interpretation as subscript
+  • Motif hints: respect maximum border style configuration set by user
+  • i3-dmenu-desktop: fix quoting bug
+  • Fix segfault during config validation
+
+ 
┌────────────────────────────┐
+ │ Thanks!                    │
+ 
└────────────────────────────┘
+
+Thanks for testing, bugfixes, discussions and everything I forgot go out to:
+
+  Erich Heine, Matias Goldfeld, Orestis Floros, Tudor Brindus, bodea
+
+-- Michael Stapelberg, 2022-10-24
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/docs/debugging.html 
new/i3-4.21.1/docs/debugging.html
--- old/i3-4.21/docs/debugging.html     2022-09-21 20:22:16.708955500 +0200
+++ new/i3-4.21.1/docs/debugging.html   2022-10-28 13:49:32.264950800 +0200
@@ -957,7 +957,7 @@
 <div id="footer">
 <div id="footer-text">
 Last updated
- 2022-09-21 20:12:41 CEST
+ 2022-10-28 13:46:28 CEST
 </div>
 </div>
 </body>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/docs/hacking-howto.html 
new/i3-4.21.1/docs/hacking-howto.html
--- old/i3-4.21/docs/hacking-howto.html 2022-09-21 20:22:16.708955500 +0200
+++ new/i3-4.21.1/docs/hacking-howto.html       2022-10-28 13:49:32.264950800 
+0200
@@ -2283,7 +2283,7 @@
 <div id="footer">
 <div id="footer-text">
 Last updated
- 2022-09-21 20:12:41 CEST
+ 2022-10-28 13:46:28 CEST
 </div>
 </div>
 </body>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/docs/i3bar-protocol.html 
new/i3-4.21.1/docs/i3bar-protocol.html
--- old/i3-4.21/docs/i3bar-protocol.html        2022-09-21 20:22:16.708955500 
+0200
+++ new/i3-4.21.1/docs/i3bar-protocol.html      2022-10-28 13:49:32.264950800 
+0200
@@ -1221,7 +1221,7 @@
 <div id="footer">
 <div id="footer-text">
 Last updated
- 2022-09-21 20:12:41 CEST
+ 2022-10-28 13:46:28 CEST
 </div>
 </div>
 </body>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/docs/ipc.html new/i3-4.21.1/docs/ipc.html
--- old/i3-4.21/docs/ipc.html   2022-09-21 20:22:16.708955500 +0200
+++ new/i3-4.21.1/docs/ipc.html 2022-10-28 13:49:32.264950800 +0200
@@ -2877,7 +2877,7 @@
 <div id="footer">
 <div id="footer-text">
 Last updated
- 2022-09-21 20:12:41 CEST
+ 2022-10-28 13:46:28 CEST
 </div>
 </div>
 </body>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/docs/layout-saving.html 
new/i3-4.21.1/docs/layout-saving.html
--- old/i3-4.21/docs/layout-saving.html 2022-09-21 20:22:16.708955500 +0200
+++ new/i3-4.21.1/docs/layout-saving.html       2022-10-28 13:49:32.264950800 
+0200
@@ -1016,7 +1016,7 @@
 <div id="footer">
 <div id="footer-text">
 Last updated
- 2022-09-21 20:12:41 CEST
+ 2022-10-28 13:46:28 CEST
 </div>
 </div>
 </body>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/docs/multi-monitor.html 
new/i3-4.21.1/docs/multi-monitor.html
--- old/i3-4.21/docs/multi-monitor.html 2022-09-21 20:22:16.708955500 +0200
+++ new/i3-4.21.1/docs/multi-monitor.html       2022-10-28 13:49:32.264950800 
+0200
@@ -816,7 +816,7 @@
 <div id="footer">
 <div id="footer-text">
 Last updated
- 2022-09-21 20:12:41 CEST
+ 2022-10-28 13:46:28 CEST
 </div>
 </div>
 </body>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/docs/testsuite.html 
new/i3-4.21.1/docs/testsuite.html
--- old/i3-4.21/docs/testsuite.html     2022-09-21 20:22:16.708955500 +0200
+++ new/i3-4.21.1/docs/testsuite.html   2022-10-28 13:49:32.264950800 +0200
@@ -1469,7 +1469,7 @@
 <div id="footer">
 <div id="footer-text">
 Last updated
- 2022-09-21 20:12:41 CEST
+ 2022-10-28 13:46:28 CEST
 </div>
 </div>
 </body>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/docs/userguide new/i3-4.21.1/docs/userguide
--- old/i3-4.21/docs/userguide  2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/docs/userguide        2022-10-28 13:46:28.000000000 +0200
@@ -196,6 +196,7 @@
 
 Floating windows are always on top of tiling windows.
 
+[[tiling_drag]]
 === Moving tiling containers with the mouse
 
 Since i3 4.21, it's possible to drag tiling containers using the mouse. The
@@ -1402,6 +1403,29 @@
 bindsym Mod1+F fullscreen toggle
 -------------------
 
+[[config_tiling_drag]]
+=== Tiling drag
+
+You can configure how to initiate the tiling drag feature (see 
<<tiling_drag>>).
+
+*Syntax*:
+--------------------------------
+tiling_drag off
+tiling_drag modifier|titlebar [modifier|titlebar]
+--------------------------------
+
+*Examples*:
+--------------------------------
+# Only initiate a tiling drag when the modifier is held:
+tiling_drag modifier
+
+# Initiate a tiling drag on either titlebar click or held modifier:
+tiling_drag modifier titlebar
+
+# Disable tiling drag altogether
+tiling_drag off
+--------------------------------
+
 == Configuring i3bar
 
 The bar at the bottom of your monitor is drawn by a separate process called
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/docs/userguide.html 
new/i3-4.21.1/docs/userguide.html
--- old/i3-4.21/docs/userguide.html     2022-09-21 20:22:16.708955500 +0200
+++ new/i3-4.21.1/docs/userguide.html   2022-10-28 13:49:32.264950800 +0200
@@ -971,7 +971,7 @@
 <div class="paragraph"><p>Floating windows are always on top of tiling 
windows.</p></div>
 </div>
 <div class="sect2">
-<h3 id="_moving_tiling_containers_with_the_mouse">2.12. Moving tiling 
containers with the mouse</h3>
+<h3 id="tiling_drag">2.12. Moving tiling containers with the mouse</h3>
 <div class="paragraph"><p>Since i3 4.21, it&#8217;s possible to drag tiling 
containers using the mouse. The
 drag can be initiated either by dragging the window&#8217;s titlebar or by 
pressing
 the <a href="#floating_modifier">[floating_modifier]</a> and dragging the 
container while holding the
@@ -2243,6 +2243,28 @@
 bindsym Mod1+F fullscreen toggle</code></pre>
 </div></div>
 </div>
+<div class="sect2">
+<h3 id="config_tiling_drag">4.33. Tiling drag</h3>
+<div class="paragraph"><p>You can configure how to initiate the tiling drag 
feature (see <a href="#tiling_drag">[tiling_drag]</a>).</p></div>
+<div class="paragraph"><p><strong>Syntax</strong>:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><code>tiling_drag off
+tiling_drag modifier|titlebar [modifier|titlebar]</code></pre>
+</div></div>
+<div class="paragraph"><p><strong>Examples</strong>:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><code># Only initiate a tiling drag when the modifier is held:
+tiling_drag modifier
+
+# Initiate a tiling drag on either titlebar click or held modifier:
+tiling_drag modifier titlebar
+
+# Disable tiling drag altogether
+tiling_drag off</code></pre>
+</div></div>
+</div>
 </div>
 </div>
 <div class="sect1">
@@ -4288,7 +4310,7 @@
 <div id="footer">
 <div id="footer-text">
 Last updated
- 2022-09-21 20:12:41 CEST
+ 2022-10-28 13:46:28 CEST
 </div>
 </div>
 </body>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/docs/wsbar.html new/i3-4.21.1/docs/wsbar.html
--- old/i3-4.21/docs/wsbar.html 2022-09-21 20:22:16.708955500 +0200
+++ new/i3-4.21.1/docs/wsbar.html       2022-10-28 13:49:32.264950800 +0200
@@ -844,7 +844,7 @@
 <div id="footer">
 <div id="footer-text">
 Last updated
- 2022-09-21 20:12:41 CEST
+ 2022-10-28 13:46:28 CEST
 </div>
 </div>
 </body>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/etc/config new/i3-4.21.1/etc/config
--- old/i3-4.21/etc/config      2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/etc/config    2022-10-28 13:46:28.000000000 +0200
@@ -49,6 +49,10 @@
 # use Mouse+Mod1 to drag floating windows to their wanted position
 floating_modifier Mod1
 
+# move tiling windows via drag & drop by left-clicking into the title bar,
+# or left-clicking anywhere into the window while holding the floating 
modifier.
+tiling_drag modifier titlebar
+
 # start a terminal
 bindsym Mod1+Return exec i3-sensible-terminal
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/etc/config.keycodes 
new/i3-4.21.1/etc/config.keycodes
--- old/i3-4.21/etc/config.keycodes     2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/etc/config.keycodes   2022-10-28 13:46:28.000000000 +0200
@@ -43,6 +43,10 @@
 # Use Mouse+$mod to drag floating windows to their wanted position
 floating_modifier $mod
 
+# move tiling windows via drag & drop by left-clicking into the title bar,
+# or left-clicking anywhere into the window while holding the floating 
modifier.
+tiling_drag modifier titlebar
+
 # start a terminal
 bindcode $mod+36 exec i3-sensible-terminal
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/i3-dmenu-desktop 
new/i3-4.21.1/i3-dmenu-desktop
--- old/i3-4.21/i3-dmenu-desktop        2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/i3-dmenu-desktop      2022-10-28 13:46:28.000000000 +0200
@@ -413,7 +413,7 @@
 my $location = $app->{_Location};
 
 # Quote as described by “The Exec key”:
-# https://standards.freedesktop.org/desktop-entry-spec/latest/ar01s06.html
+# https://standards.freedesktop.org/desktop-entry-spec/latest/ar01s07.html
 sub quote {
     my ($str) = @_;
     $str =~ s/("|`|\$|\\)/\\$1/g;
@@ -425,6 +425,17 @@
 $location = quote($location);
 $name = quote($name);
 
+# https://standards.freedesktop.org/desktop-entry-spec/latest/ar01s07.html:
+#
+# Note that the general escape rule for values of type string states that the
+# backslash character can be escaped as ("\\") as well and that this escape 
rule
+# is applied before the quoting rule. As such, to unambiguously represent a
+# literal backslash character in a quoted argument in a desktop entry file
+# requires the use of four successive backslash characters ("\\\\"). Likewise, 
a
+# literal dollar sign in a quoted argument in a desktop entry file is
+# unambiguously represented with ("\\$").
+$exec =~ s/\\\\/\\/g;
+
 # Remove deprecated field codes, as the spec dictates.
 $exec =~ s/%[dDnNvm]//g;
 
@@ -481,9 +492,10 @@
     # starts with a double quote ("), everything is parsed as-is until the next
     # double quote which is NOT preceded by a backslash (\).
     #
-    # Therefore, we escape all double quotes (") by replacing them with \"
-    $exec =~ s/\\"/\\\\\\"/g;
-    $exec =~ s/([^\\])"/$1\\"/g;
+    # Therefore, we escape all double quotes (") by replacing them with \".
+    # To not change the meaning of any double quote, backslashes need to be
+    # escaped as well.
+    $exec =~ s/(["\\])/\\$1/g;
 
     if (exists($app->{StartupNotify}) && !$app->{StartupNotify}) {
         $nosn = '--no-startup-id';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/include/con.h new/i3-4.21.1/include/con.h
--- old/i3-4.21/include/con.h   2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/include/con.h 2022-10-28 13:46:28.000000000 +0200
@@ -451,7 +451,7 @@
  * floating window.
  *
  */
-void con_set_border_style(Con *con, int border_style, int border_width);
+void con_set_border_style(Con *con, border_style_t border_style, int 
border_width);
 
 /**
  * This function changes the layout of a given container. Use it to handle
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/include/config_directives.h 
new/i3-4.21.1/include/config_directives.h
--- old/i3-4.21/include/config_directives.h     2022-09-21 20:12:41.000000000 
+0200
+++ new/i3-4.21.1/include/config_directives.h   2022-10-28 13:46:28.000000000 
+0200
@@ -68,6 +68,7 @@
 CFGFUN(no_focus);
 CFGFUN(ipc_socket, const char *path);
 CFGFUN(ipc_kill_timeout, const long timeout_ms);
+CFGFUN(tiling_drag, const char *value);
 CFGFUN(restart_state, const char *path);
 CFGFUN(popup_during_fullscreen, const char *value);
 CFGFUN(color, const char *colorclass, const char *border, const char 
*background, const char *text, const char *indicator, const char *child_border);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/include/configuration.h 
new/i3-4.21.1/include/configuration.h
--- old/i3-4.21/include/configuration.h 2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/include/configuration.h       2022-10-28 13:46:28.000000000 
+0200
@@ -14,6 +14,7 @@
 
 #include "queue.h"
 #include "i3.h"
+#include "tiling_drag.h"
 
 typedef struct IncludedFile IncludedFile;
 typedef struct Config Config;
@@ -266,6 +267,8 @@
     /* The number of currently parsed barconfigs */
     int number_barconfigs;
 
+    tiling_drag_t tiling_drag;
+
     /* Gap sizes */
     gaps_t gaps;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/include/data.h new/i3-4.21.1/include/data.h
--- old/i3-4.21/include/data.h  2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/include/data.h        2022-10-28 13:46:28.000000000 +0200
@@ -62,9 +62,11 @@
                VERT } orientation_t;
 typedef enum { BEFORE,
                AFTER } position_t;
-typedef enum { BS_NORMAL = 0,
-               BS_NONE = 1,
-               BS_PIXEL = 2 } border_style_t;
+typedef enum {
+    BS_NONE = 0,
+    BS_PIXEL = 1,
+    BS_NORMAL = 2,
+} border_style_t;
 
 /** parameter to specify whether tree_close_internal() and x_window_kill() 
should kill
  * only this specific window or the whole X11 client */
@@ -743,7 +745,16 @@
      * layout in workspace_layout and creates a new split container with that
      * layout whenever a new container is attached to the workspace. */
     layout_t layout, last_split_layout, workspace_layout;
+
     border_style_t border_style;
+    /* When the border style of a con changes because of motif hints, we don't
+     * want to set more decoration that the user wants. The user's preference 
is determined by these:
+     * 1. For new tiling windows, as set by `default_border`
+     * 2. For new floating windows, as set by `default_floating_border`
+     * 3. For all windows that the user runs the `border` command, whatever is
+     * the result of that command for that window. */
+    border_style_t max_user_border_style;
+
     /** floating? (= not in tiling layout) This cannot be simply a bool
      * because we want to keep track of whether the status was set by the
      * application (by setting _NET_WM_WINDOW_TYPE appropriately) or by the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/include/tiling_drag.h 
new/i3-4.21.1/include/tiling_drag.h
--- old/i3-4.21/include/tiling_drag.h   2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/include/tiling_drag.h 2022-10-28 13:46:28.000000000 +0200
@@ -9,8 +9,27 @@
  */
 #pragma once
 
+#include "all.h"
+
+/**
+ * Tiling drag initiation modes.
+ */
+typedef enum {
+    TILING_DRAG_OFF = 0,
+    TILING_DRAG_MODIFIER = 1,
+    TILING_DRAG_TITLEBAR = 2,
+    TILING_DRAG_MODIFIER_OR_TITLEBAR = 3
+} tiling_drag_t;
+
+/**
+ * Returns whether there currently are any drop targets.
+ * Used to only initiate a drag when there is something to drop onto.
+ *
+ */
+bool has_drop_targets(void);
+
 /**
  * Initiates a mouse drag operation on a tiled window.
  *
  */
-void tiling_drag(Con *con, xcb_button_press_event_t *event);
+void tiling_drag(Con *con, xcb_button_press_event_t *event, bool 
use_threshold);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/man/i3-config-wizard.1 
new/i3-4.21.1/man/i3-config-wizard.1
--- old/i3-4.21/man/i3-config-wizard.1  2022-09-21 20:22:16.705622200 +0200
+++ new/i3-4.21.1/man/i3-config-wizard.1        2022-10-28 13:49:32.261617400 
+0200
@@ -2,12 +2,12 @@
 .\"     Title: i3-config-wizard
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\"      Date: 09/21/2022
+.\"      Date: 10/28/2022
 .\"    Manual: i3 Manual
-.\"    Source: i3 4.21
+.\"    Source: i3 4.21.1
 .\"  Language: English
 .\"
-.TH "I3\-CONFIG\-WIZARD" "1" "09/21/2022" "i3 4\&.21" "i3 Manual"
+.TH "I3\-CONFIG\-WIZARD" "1" "10/28/2022" "i3 4\&.21\&.1" "i3 Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -59,7 +59,7 @@
 This file contains the default configuration with keycodes\&. All the bindcode 
lines will be transformed to bindsym and the user\-specified modifier will be 
used\&.
 .SH "DESCRIPTION"
 .sp
-i3\-config\-wizard is started by i3 in its default config, unless 
/\&.i3/config exists\&. i3\-config\-wizard creates a keysym based i3 config 
file (based on /etc/i3/config\&.keycodes) in /\&.i3/config\&.
+i3\-config\-wizard is started by i3 in its default config, unless 
~/\&.i3/config exists\&. i3\-config\-wizard creates a keysym based i3 config 
file (based on /etc/i3/config\&.keycodes) in ~/\&.i3/config\&.
 .sp
 The advantage of using keysyms is that the config file is easy to read, 
understand and modify\&. However, if we shipped with a keysym based default 
config file, the key positions would not be consistent across different 
keyboard layouts (take for example the homerow for movement)\&. Therefore, we 
ship with a keycode based default config and let the wizard transform it 
according to your current keyboard layout\&.
 .SH "SEE ALSO"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/man/i3-config-wizard.man 
new/i3-4.21.1/man/i3-config-wizard.man
--- old/i3-4.21/man/i3-config-wizard.man        2022-09-21 20:12:41.000000000 
+0200
+++ new/i3-4.21.1/man/i3-config-wizard.man      2022-10-28 13:46:28.000000000 
+0200
@@ -35,7 +35,7 @@
 
 == DESCRIPTION
 
-i3-config-wizard is started by i3 in its default config, unless ~/.i3/config
+i3-config-wizard is started by i3 in its default config, unless \~/.i3/config
 exists. i3-config-wizard creates a keysym based i3 config file (based on
 /etc/i3/config.keycodes) in ~/.i3/config.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/man/i3-dmenu-desktop.1 
new/i3-4.21.1/man/i3-dmenu-desktop.1
--- old/i3-4.21/man/i3-dmenu-desktop.1  2022-09-21 20:22:16.705622200 +0200
+++ new/i3-4.21.1/man/i3-dmenu-desktop.1        2022-10-28 13:49:32.261617400 
+0200
@@ -71,7 +71,7 @@
 .\" ========================================================================
 .\"
 .IX Title "I3-DMENU-DESKTOP 1"
-.TH I3-DMENU-DESKTOP 1 "2022-09-21" "perl v5.36.0" "User Contributed Perl 
Documentation"
+.TH I3-DMENU-DESKTOP 1 "2022-10-28" "perl v5.36.0" "User Contributed Perl 
Documentation"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/man/i3-dump-log.1 
new/i3-4.21.1/man/i3-dump-log.1
--- old/i3-4.21/man/i3-dump-log.1       2022-09-21 20:22:16.705622200 +0200
+++ new/i3-4.21.1/man/i3-dump-log.1     2022-10-28 13:49:32.261617400 +0200
@@ -2,12 +2,12 @@
 .\"     Title: i3-dump-log
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\"      Date: 09/21/2022
+.\"      Date: 10/28/2022
 .\"    Manual: i3 Manual
-.\"    Source: i3 4.21
+.\"    Source: i3 4.21.1
 .\"  Language: English
 .\"
-.TH "I3\-DUMP\-LOG" "1" "09/21/2022" "i3 4\&.21" "i3 Manual"
+.TH "I3\-DUMP\-LOG" "1" "10/28/2022" "i3 4\&.21\&.1" "i3 Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/man/i3-input.1 new/i3-4.21.1/man/i3-input.1
--- old/i3-4.21/man/i3-input.1  2022-09-21 20:22:16.705622200 +0200
+++ new/i3-4.21.1/man/i3-input.1        2022-10-28 13:49:32.261617400 +0200
@@ -2,12 +2,12 @@
 .\"     Title: i3-input
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\"      Date: 09/21/2022
+.\"      Date: 10/28/2022
 .\"    Manual: i3 Manual
-.\"    Source: i3 4.21
+.\"    Source: i3 4.21.1
 .\"  Language: English
 .\"
-.TH "I3\-INPUT" "1" "09/21/2022" "i3 4\&.21" "i3 Manual"
+.TH "I3\-INPUT" "1" "10/28/2022" "i3 4\&.21\&.1" "i3 Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/man/i3-migrate-config-to-v4.1 
new/i3-4.21.1/man/i3-migrate-config-to-v4.1
--- old/i3-4.21/man/i3-migrate-config-to-v4.1   2022-09-21 20:22:16.705622200 
+0200
+++ new/i3-4.21.1/man/i3-migrate-config-to-v4.1 2022-10-28 13:49:32.261617400 
+0200
@@ -2,12 +2,12 @@
 .\"     Title: i3-migrate-config-to-v4
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\"      Date: 09/21/2022
+.\"      Date: 10/28/2022
 .\"    Manual: i3 Manual
-.\"    Source: i3 4.21
+.\"    Source: i3 4.21.1
 .\"  Language: English
 .\"
-.TH "I3\-MIGRATE\-CONFIG\-TO\-V4" "1" "09/21/2022" "i3 4\&.21" "i3 Manual"
+.TH "I3\-MIGRATE\-CONFIG\-TO\-V4" "1" "10/28/2022" "i3 4\&.21\&.1" "i3 Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/man/i3-msg.1 new/i3-4.21.1/man/i3-msg.1
--- old/i3-4.21/man/i3-msg.1    2022-09-21 20:22:16.705622200 +0200
+++ new/i3-4.21.1/man/i3-msg.1  2022-10-28 13:49:32.261617400 +0200
@@ -2,12 +2,12 @@
 .\"     Title: i3-msg
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\"      Date: 09/21/2022
+.\"      Date: 10/28/2022
 .\"    Manual: i3 Manual
-.\"    Source: i3 4.21
+.\"    Source: i3 4.21.1
 .\"  Language: English
 .\"
-.TH "I3\-MSG" "1" "09/21/2022" "i3 4\&.21" "i3 Manual"
+.TH "I3\-MSG" "1" "10/28/2022" "i3 4\&.21\&.1" "i3 Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/man/i3-nagbar.1 new/i3-4.21.1/man/i3-nagbar.1
--- old/i3-4.21/man/i3-nagbar.1 2022-09-21 20:22:16.705622200 +0200
+++ new/i3-4.21.1/man/i3-nagbar.1       2022-10-28 13:49:32.261617400 +0200
@@ -2,12 +2,12 @@
 .\"     Title: i3-nagbar
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\"      Date: 09/21/2022
+.\"      Date: 10/28/2022
 .\"    Manual: i3 Manual
-.\"    Source: i3 4.21
+.\"    Source: i3 4.21.1
 .\"  Language: English
 .\"
-.TH "I3\-NAGBAR" "1" "09/21/2022" "i3 4\&.21" "i3 Manual"
+.TH "I3\-NAGBAR" "1" "10/28/2022" "i3 4\&.21\&.1" "i3 Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/man/i3-save-tree.1 
new/i3-4.21.1/man/i3-save-tree.1
--- old/i3-4.21/man/i3-save-tree.1      2022-09-21 20:22:16.705622200 +0200
+++ new/i3-4.21.1/man/i3-save-tree.1    2022-10-28 13:49:32.261617400 +0200
@@ -71,7 +71,7 @@
 .\" ========================================================================
 .\"
 .IX Title "I3-SAVE-TREE 1"
-.TH I3-SAVE-TREE 1 "2022-09-21" "perl v5.36.0" "User Contributed Perl 
Documentation"
+.TH I3-SAVE-TREE 1 "2022-10-28" "perl v5.36.0" "User Contributed Perl 
Documentation"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/man/i3-sensible-editor.1 
new/i3-4.21.1/man/i3-sensible-editor.1
--- old/i3-4.21/man/i3-sensible-editor.1        2022-09-21 20:22:16.708955500 
+0200
+++ new/i3-4.21.1/man/i3-sensible-editor.1      2022-10-28 13:49:32.261617400 
+0200
@@ -2,12 +2,12 @@
 .\"     Title: i3-sensible-editor
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\"      Date: 09/21/2022
+.\"      Date: 10/28/2022
 .\"    Manual: i3 Manual
-.\"    Source: i3 4.21
+.\"    Source: i3 4.21.1
 .\"  Language: English
 .\"
-.TH "I3\-SENSIBLE\-EDITOR" "1" "09/21/2022" "i3 4\&.21" "i3 Manual"
+.TH "I3\-SENSIBLE\-EDITOR" "1" "10/28/2022" "i3 4\&.21\&.1" "i3 Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/man/i3-sensible-pager.1 
new/i3-4.21.1/man/i3-sensible-pager.1
--- old/i3-4.21/man/i3-sensible-pager.1 2022-09-21 20:22:16.708955500 +0200
+++ new/i3-4.21.1/man/i3-sensible-pager.1       2022-10-28 13:49:32.261617400 
+0200
@@ -2,12 +2,12 @@
 .\"     Title: i3-sensible-pager
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\"      Date: 09/21/2022
+.\"      Date: 10/28/2022
 .\"    Manual: i3 Manual
-.\"    Source: i3 4.21
+.\"    Source: i3 4.21.1
 .\"  Language: English
 .\"
-.TH "I3\-SENSIBLE\-PAGER" "1" "09/21/2022" "i3 4\&.21" "i3 Manual"
+.TH "I3\-SENSIBLE\-PAGER" "1" "10/28/2022" "i3 4\&.21\&.1" "i3 Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/man/i3-sensible-terminal.1 
new/i3-4.21.1/man/i3-sensible-terminal.1
--- old/i3-4.21/man/i3-sensible-terminal.1      2022-09-21 20:22:16.708955500 
+0200
+++ new/i3-4.21.1/man/i3-sensible-terminal.1    2022-10-28 13:49:32.261617400 
+0200
@@ -2,12 +2,12 @@
 .\"     Title: i3-sensible-terminal
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\"      Date: 09/21/2022
+.\"      Date: 10/28/2022
 .\"    Manual: i3 Manual
-.\"    Source: i3 4.21
+.\"    Source: i3 4.21.1
 .\"  Language: English
 .\"
-.TH "I3\-SENSIBLE\-TERMINAL" "1" "09/21/2022" "i3 4\&.21" "i3 Manual"
+.TH "I3\-SENSIBLE\-TERMINAL" "1" "10/28/2022" "i3 4\&.21\&.1" "i3 Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/man/i3.1 new/i3-4.21.1/man/i3.1
--- old/i3-4.21/man/i3.1        2022-09-21 20:22:16.705622200 +0200
+++ new/i3-4.21.1/man/i3.1      2022-10-28 13:49:32.261617400 +0200
@@ -2,12 +2,12 @@
 .\"     Title: i3
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\"      Date: 09/21/2022
+.\"      Date: 10/28/2022
 .\"    Manual: i3 Manual
-.\"    Source: i3 4.21
+.\"    Source: i3 4.21.1
 .\"  Language: English
 .\"
-.TH "I3" "1" "09/21/2022" "i3 4\&.21" "i3 Manual"
+.TH "I3" "1" "10/28/2022" "i3 4\&.21\&.1" "i3 Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/man/i3bar.1 new/i3-4.21.1/man/i3bar.1
--- old/i3-4.21/man/i3bar.1     2022-09-21 20:22:16.705622200 +0200
+++ new/i3-4.21.1/man/i3bar.1   2022-10-28 13:49:32.261617400 +0200
@@ -2,12 +2,12 @@
 .\"     Title: i3bar
 .\"    Author: [see the "AUTHORS" section]
 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\"      Date: 09/21/2022
+.\"      Date: 10/28/2022
 .\"    Manual: i3 Manual
-.\"    Source: i3 4.21
+.\"    Source: i3 4.21.1
 .\"  Language: English
 .\"
-.TH "I3BAR" "1" "09/21/2022" "i3 4\&.21" "i3 Manual"
+.TH "I3BAR" "1" "10/28/2022" "i3 4\&.21\&.1" "i3 Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/meson.build new/i3-4.21.1/meson.build
--- old/i3-4.21/meson.build     2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/meson.build   2022-10-28 13:46:28.000000000 +0200
@@ -6,7 +6,7 @@
 project(
   'i3',
   'c',
-  version: '4.21',
+  version: '4.21.1',
   default_options: [
     'c_std=c11',
     'warning_level=1',  # enable all warnings (-Wall)
@@ -63,7 +63,7 @@
   sources: vcs_tag(
     input: config_h_in,
     output: 'config.h',
-    fallback: meson.project_version() + ' (2022-09-21)',
+    fallback: meson.project_version() + ' (2022-10-28)',
   )
 )
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/parser-specs/config.spec 
new/i3-4.21.1/parser-specs/config.spec
--- old/i3-4.21/parser-specs/config.spec        2022-09-21 20:12:41.000000000 
+0200
+++ new/i3-4.21.1/parser-specs/config.spec      2022-10-28 13:46:28.000000000 
+0200
@@ -56,6 +56,7 @@
   'ipc_kill_timeout'                       -> IPC_KILL_TIMEOUT
   'restart_state'                          -> RESTART_STATE
   'popup_during_fullscreen'                -> POPUP_DURING_FULLSCREEN
+  'tiling_drag'                            -> TILING_DRAG
   exectype = 'exec_always', 'exec'         -> EXEC
   colorclass = 'client.background'
       -> COLOR_SINGLE
@@ -362,6 +363,18 @@
   value = 'ignore', 'leave_fullscreen', 'smart'
       -> call cfg_popup_during_fullscreen($value)
 
+state TILING_DRAG_MODE:
+  value = 'modifier', 'titlebar'
+      ->
+  end
+      -> call cfg_tiling_drag($value)
+
+state TILING_DRAG:
+  off = '0', 'no', 'false', 'off', 'disable', 'inactive'
+      -> call cfg_tiling_drag($off)
+  value = 'modifier', 'titlebar'
+      -> TILING_DRAG_MODE
+
 # client.background <hexcolor>
 state COLOR_SINGLE:
   color = word
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/release-notes/bugfixes/1-motifs 
new/i3-4.21.1/release-notes/bugfixes/1-motifs
--- old/i3-4.21/release-notes/bugfixes/1-motifs 1970-01-01 01:00:00.000000000 
+0100
+++ new/i3-4.21.1/release-notes/bugfixes/1-motifs       2022-10-28 
13:46:28.000000000 +0200
@@ -0,0 +1 @@
+motif hints: respect maximum border style configuration set by user 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/release-notes/bugfixes/2-focus-click 
new/i3-4.21.1/release-notes/bugfixes/2-focus-click
--- old/i3-4.21/release-notes/bugfixes/2-focus-click    1970-01-01 
01:00:00.000000000 +0100
+++ new/i3-4.21.1/release-notes/bugfixes/2-focus-click  2022-10-28 
13:46:28.000000000 +0200
@@ -0,0 +1 @@
+tiling drag: allow click immediately, to focus on decoration click
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/release-notes/bugfixes/3-drag-cursor 
new/i3-4.21.1/release-notes/bugfixes/3-drag-cursor
--- old/i3-4.21/release-notes/bugfixes/3-drag-cursor    1970-01-01 
01:00:00.000000000 +0100
+++ new/i3-4.21.1/release-notes/bugfixes/3-drag-cursor  2022-10-28 
13:46:28.000000000 +0200
@@ -0,0 +1 @@
+fix tiling drag cursor: should be “move”, accidentally was “top right 
corner”
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/release-notes/bugfixes/4-drop-scratchpad 
new/i3-4.21.1/release-notes/bugfixes/4-drop-scratchpad
--- old/i3-4.21/release-notes/bugfixes/4-drop-scratchpad        1970-01-01 
01:00:00.000000000 +0100
+++ new/i3-4.21.1/release-notes/bugfixes/4-drop-scratchpad      2022-10-28 
13:46:28.000000000 +0200
@@ -0,0 +1 @@
+tiling drag: ignore scratchpad windows when locating drop targets
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/release-notes/changes/1-tiling-drag 
new/i3-4.21.1/release-notes/changes/1-tiling-drag
--- old/i3-4.21/release-notes/changes/1-tiling-drag     1970-01-01 
01:00:00.000000000 +0100
+++ new/i3-4.21.1/release-notes/changes/1-tiling-drag   2022-10-28 
13:46:28.000000000 +0200
@@ -0,0 +1 @@
+tiling drag is now configurable, and defaults to “modifier” for existing 
configs
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/release-notes/changes/2-tiling-drag-targets 
new/i3-4.21.1/release-notes/changes/2-tiling-drag-targets
--- old/i3-4.21/release-notes/changes/2-tiling-drag-targets     1970-01-01 
01:00:00.000000000 +0100
+++ new/i3-4.21.1/release-notes/changes/2-tiling-drag-targets   2022-10-28 
13:46:28.000000000 +0200
@@ -0,0 +1 @@
+tiling drag: only initiate when there are drop targets
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/src/click.c new/i3-4.21.1/src/click.c
--- old/i3-4.21/src/click.c     2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/src/click.c   2022-10-28 13:46:28.000000000 +0200
@@ -141,6 +141,12 @@
     return false;
 }
 
+static void allow_replay_pointer(xcb_timestamp_t time) {
+    xcb_allow_events(conn, XCB_ALLOW_REPLAY_POINTER, time);
+    xcb_flush(conn);
+    tree_render();
+}
+
 /*
  * Being called by handle_button_press, this function calls the appropriate
  * functions for resizing/dragging.
@@ -152,8 +158,10 @@
     DLOG("type = %d, name = %s\n", con->type, con->name);
 
     /* don’t handle dockarea cons, they must not be focused */
-    if (con->parent->type == CT_DOCKAREA)
-        goto done;
+    if (con->parent->type == CT_DOCKAREA) {
+        allow_replay_pointer(event->time);
+        return;
+    }
 
     /* if the user has bound an action to this click, it should override the
      * default behavior. */
@@ -173,7 +181,8 @@
 
     /* There is no default behavior for button release events so we are done. 
*/
     if (event->response_type == XCB_BUTTON_RELEASE) {
-        goto done;
+        allow_replay_pointer(event->time);
+        return;
     }
 
     /* Any click in a workspace should focus that workspace. If the
@@ -184,8 +193,10 @@
 
     if (!ws) {
         ws = 
TAILQ_FIRST(&(output_get_content(con_get_output(con))->focus_head));
-        if (!ws)
-            goto done;
+        if (!ws) {
+            allow_replay_pointer(event->time);
+            return;
+        }
     }
 
     /* get the floating con */
@@ -212,13 +223,19 @@
         Con *next = get_tree_next_sibling(current, direction);
         con_activate(con_descend_focused(next ? next : current));
 
-        goto done;
+        allow_replay_pointer(event->time);
+        return;
     }
 
     /* 2: floating modifier pressed, initiate a drag */
-    if (mod_pressed && event->detail == XCB_BUTTON_INDEX_1 && !floatingcon) {
-        tiling_drag(con, event);
-        goto done;
+    if (mod_pressed && is_left_click && !floatingcon &&
+        (config.tiling_drag == TILING_DRAG_MODIFIER ||
+         config.tiling_drag == TILING_DRAG_MODIFIER_OR_TITLEBAR) &&
+        has_drop_targets()) {
+        const bool use_threshold = !mod_pressed;
+        tiling_drag(con, event, use_threshold);
+        allow_replay_pointer(event->time);
+        return;
     }
 
     /* 3: focus this con or one of its children. */
@@ -262,8 +279,10 @@
             is_left_or_right_click) {
             /* try tiling resize, but continue if it doesn’t work */
             DLOG("tiling resize with fallback\n");
-            if (tiling_resize(con, event, dest, dest == CLICK_DECORATION && 
!was_focused))
-                goto done;
+            if (tiling_resize(con, event, dest, dest == CLICK_DECORATION && 
!was_focused)) {
+                allow_replay_pointer(event->time);
+                return;
+            }
         }
 
         if (dest == CLICK_DECORATION && is_right_click) {
@@ -285,13 +304,20 @@
             return;
         }
 
-        goto done;
+        allow_replay_pointer(event->time);
+        return;
     }
 
-    /* 8: floating modifier pressed, initiate a drag */
-    if ((mod_pressed || dest == CLICK_DECORATION) && event->detail == 
XCB_BUTTON_INDEX_1) {
-        tiling_drag(con, event);
-        goto done;
+    /* 8: floating modifier pressed, or click in titlebar, initiate a drag */
+    if (is_left_click &&
+        ((config.tiling_drag == TILING_DRAG_TITLEBAR && dest == 
CLICK_DECORATION) ||
+         (config.tiling_drag == TILING_DRAG_MODIFIER_OR_TITLEBAR &&
+          (mod_pressed || dest == CLICK_DECORATION))) &&
+        has_drop_targets()) {
+        allow_replay_pointer(event->time);
+        const bool use_threshold = !mod_pressed;
+        tiling_drag(con, event, use_threshold);
+        return;
     }
 
     /* 9: floating modifier pressed, initiate a resize */
@@ -312,10 +338,7 @@
         tiling_resize(con, event, dest, dest == CLICK_DECORATION && 
!was_focused);
     }
 
-done:
-    xcb_allow_events(conn, XCB_ALLOW_REPLAY_POINTER, event->time);
-    xcb_flush(conn);
-    tree_render();
+    allow_replay_pointer(event->time);
 }
 
 /*
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/src/commands.c new/i3-4.21.1/src/commands.c
--- old/i3-4.21/src/commands.c  2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/src/commands.c        2022-10-28 13:46:28.000000000 +0200
@@ -747,6 +747,8 @@
             return;
         }
 
+        /* User changed the border */
+        current->con->max_user_border_style = border_style;
         const int con_border_width = border_width_from_style(border_style, 
border_width, current->con);
         con_set_border_style(current->con, border_style, con_border_width);
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/src/con.c new/i3-4.21.1/src/con.c
--- old/i3-4.21/src/con.c       2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/src/con.c     2022-10-28 13:46:28.000000000 +0200
@@ -41,7 +41,7 @@
     TAILQ_INSERT_TAIL(&all_cons, new, all_cons);
     new->type = CT_CON;
     new->window = window;
-    new->border_style = config.default_border;
+    new->border_style = new->max_user_border_style = config.default_border;
     new->current_border_width = -1;
     new->window_icon_padding = -1;
     if (window) {
@@ -1809,7 +1809,11 @@
  * floating window.
  *
  */
-void con_set_border_style(Con *con, int border_style, int border_width) {
+void con_set_border_style(Con *con, border_style_t border_style, int 
border_width) {
+    if (border_style > con->max_user_border_style) {
+        border_style = con->max_user_border_style;
+    }
+
     /* Handle the simple case: non-floating containerns */
     if (!con_is_floating(con)) {
         con->border_style = border_style;
@@ -1822,8 +1826,6 @@
      * con->rect represent the absolute position of the window (same for
      * parent). Then, we change the border style and subtract the new border
      * pixels. For the parent, we do the same also for the decoration. */
-    DLOG("This is a floating container\n");
-
     Con *parent = con->parent;
     Rect bsr = con_border_style_rect(con);
     int deco_height = (con->border_style == BS_NORMAL ? render_deco_height() : 
0);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/src/config.c new/i3-4.21.1/src/config.c
--- old/i3-4.21/src/config.c    2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/src/config.c  2022-10-28 13:46:28.000000000 +0200
@@ -228,6 +228,8 @@
 
     config.focus_wrapping = FOCUS_WRAPPING_ON;
 
+    config.tiling_drag = TILING_DRAG_MODIFIER;
+
     FREE(current_configpath);
     current_configpath = get_config_path(override_configpath, true);
     if (current_configpath == NULL) {
@@ -281,11 +283,13 @@
 
     /* Make bar config blocks without a configured font use the i3-wide font. 
*/
     Barconfig *current;
-    TAILQ_FOREACH (current, &barconfigs, configs) {
-        if (current->font != NULL) {
-            continue;
+    if (load_type != C_VALIDATE) {
+        TAILQ_FOREACH (current, &barconfigs, configs) {
+            if (current->font != NULL) {
+                continue;
+            }
+            current->font = sstrdup(config.font.pattern);
         }
-        current->font = sstrdup(config.font.pattern);
     }
 
     if (load_type == C_RELOAD) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/src/config_directives.c 
new/i3-4.21.1/src/config_directives.c
--- old/i3-4.21/src/config_directives.c 2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/src/config_directives.c       2022-10-28 13:46:28.000000000 
+0200
@@ -718,6 +718,20 @@
     ipc_set_kill_timeout(timeout_ms / 1000.0);
 }
 
+CFGFUN(tiling_drag, const char *value) {
+    if (strcmp(value, "modifier") == 0) {
+        config.tiling_drag = TILING_DRAG_MODIFIER;
+    } else if (strcmp(value, "titlebar") == 0) {
+        config.tiling_drag = TILING_DRAG_TITLEBAR;
+    } else if (strcmp(value, "modifier,titlebar") == 0 ||
+               strcmp(value, "titlebar,modifier") == 0) {
+        /* Switch the above to strtok() or similar if we ever grow more 
options */
+        config.tiling_drag = TILING_DRAG_MODIFIER_OR_TITLEBAR;
+    } else {
+        config.tiling_drag = TILING_DRAG_OFF;
+    }
+}
+
 
/*******************************************************************************
  * Bar configuration (i3bar)
  
******************************************************************************/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/src/drag.c new/i3-4.21.1/src/drag.c
--- old/i3-4.21/src/drag.c      2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/src/drag.c    2022-10-28 13:46:28.000000000 +0200
@@ -42,7 +42,8 @@
 
 static bool threshold_exceeded(uint32_t x1, uint32_t y1,
                                uint32_t x2, uint32_t y2) {
-    const uint32_t threshold = 9;
+    /* The threshold is about the height of one window decoration. */
+    const uint32_t threshold = logical_px(15);
     return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) > threshold * 
threshold;
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/src/floating.c new/i3-4.21.1/src/floating.c
--- old/i3-4.21/src/floating.c  2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/src/floating.c        2022-10-28 13:46:28.000000000 +0200
@@ -347,8 +347,9 @@
     con->floating = FLOATING_USER_ON;
 
     /* 4: set the border style as specified with new_float */
-    if (automatic)
-        con->border_style = config.default_floating_border;
+    if (automatic) {
+        con->border_style = con->max_user_border_style = 
config.default_floating_border;
+    }
 
     /* Add pixels for the decoration. */
     Rect border_style_rect = con_border_style_rect(con);
@@ -698,6 +699,10 @@
                             const xcb_button_press_event_t *event) {
     DLOG("floating_resize_window\n");
 
+    /* Push changes before resizing, so that the window gets raised now and not
+     * after the user releases the mouse button */
+    tree_render();
+
     /* corner saves the nearest corner to the original click. It contains
      * a bitmask of the nearest borders (BORDER_LEFT, BORDER_RIGHT, …) */
     border_t corner = 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/src/manage.c new/i3-4.21.1/src/manage.c
--- old/i3-4.21/src/manage.c    2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/src/manage.c  2022-10-28 13:46:28.000000000 +0200
@@ -511,6 +511,13 @@
     if (nc->geometry.width == 0)
         nc->geometry = (Rect){geom->x, geom->y, geom->width, geom->height};
 
+    if (want_floating) {
+        DLOG("geometry = %d x %d\n", nc->geometry.width, nc->geometry.height);
+        if (floating_enable(nc, true)) {
+            nc->floating = FLOATING_AUTO_ON;
+        }
+    }
+
     if (has_mwm_hints) {
         DLOG("MOTIF_WM_HINTS specifies decorations (border_style = %d)\n", 
motif_border_style);
         if (want_floating) {
@@ -520,17 +527,6 @@
         }
     }
 
-    if (want_floating) {
-        DLOG("geometry = %d x %d\n", nc->geometry.width, nc->geometry.height);
-        /* automatically set the border to the default value if a motif border
-         * was not specified */
-        bool automatic_border = (motif_border_style == BS_NORMAL);
-
-        if (floating_enable(nc, automatic_border)) {
-            nc->floating = FLOATING_AUTO_ON;
-        }
-    }
-
     /* explicitly set the border width to the default */
     if (nc->current_border_width == -1) {
         nc->current_border_width = (want_floating ? 
config.default_floating_border_width : config.default_border_width);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/src/tiling_drag.c 
new/i3-4.21.1/src/tiling_drag.c
--- old/i3-4.21/src/tiling_drag.c       2022-09-21 20:12:41.000000000 +0200
+++ new/i3-4.21.1/src/tiling_drag.c     2022-10-28 13:46:28.000000000 +0200
@@ -27,6 +27,62 @@
     return rect;
 }
 
+static bool is_tiling_drop_target(Con *con) {
+    if (!con_has_managed_window(con) ||
+        con_is_floating(con) ||
+        con_is_hidden(con)) {
+        return false;
+    }
+    Con *ws = con_get_workspace(con);
+    if (con_is_internal(ws)) {
+        /* Skip containers on i3-internal containers like the scratchpad, 
which are
+           technically visible on their pseudo-output. */
+        return false;
+    }
+    if (!workspace_is_visible(ws)) {
+        return false;
+    }
+    Con *fs = con_get_fullscreen_covering_ws(ws);
+    if (fs != NULL && fs != con) {
+        /* Workspace is visible, but con is not visible because some other
+           container is in fullscreen. */
+        return false;
+    }
+    return true;
+}
+
+/*
+ * Returns whether there currently are any drop targets.
+ * Used to only initiate a drag when there is something to drop onto.
+ *
+ */
+bool has_drop_targets(void) {
+    int drop_targets = 0;
+    Con *con;
+    TAILQ_FOREACH (con, &all_cons, all_cons) {
+        if (!is_tiling_drop_target(con)) {
+            continue;
+        }
+        drop_targets++;
+    }
+
+    /* In addition to tiling containers themselves, an visible but empty
+     * workspace (in a multi-monitor scenario) also is a drop target. */
+    Con *output;
+    TAILQ_FOREACH (output, &(croot->focus_head), focused) {
+        if (con_is_internal(output)) {
+            continue;
+        }
+        Con *visible_ws = NULL;
+        GREP_FIRST(visible_ws, output_get_content(output), 
workspace_is_visible(child));
+        if (visible_ws != NULL && con_num_children(visible_ws) == 0) {
+            drop_targets++;
+        }
+    }
+
+    return drop_targets > 1;
+}
+
 /*
  * Return an appropriate target at given coordinates.
  *
@@ -35,18 +91,13 @@
     Con *con;
     TAILQ_FOREACH (con, &all_cons, all_cons) {
         Rect rect = con_rect_plus_deco_height(con);
-
-        if (rect_contains(rect, x, y) &&
-            con_has_managed_window(con) &&
-            !con_is_floating(con) &&
-            !con_is_hidden(con)) {
-            Con *ws = con_get_workspace(con);
-            if (!workspace_is_visible(ws)) {
-                continue;
-            }
-            Con *fs = con_get_fullscreen_covering_ws(ws);
-            return fs ? fs : con;
+        if (!rect_contains(rect, x, y) ||
+            !is_tiling_drop_target(con)) {
+            continue;
         }
+        Con *ws = con_get_workspace(con);
+        Con *fs = con_get_fullscreen_covering_ws(ws);
+        return fs ? fs : con;
     }
 
     /* Couldn't find leaf container, get a workspace. */
@@ -267,7 +318,7 @@
  * Initiates a mouse drag operation on a tiled window.
  *
  */
-void tiling_drag(Con *con, xcb_button_press_event_t *event) {
+void tiling_drag(Con *con, xcb_button_press_event_t *event, bool 
use_threshold) {
     DLOG("Start dragging tiled container: con = %p\n", con);
     bool set_focus = (con == focused);
     bool set_fs = con->fullscreen_mode != CF_NONE;
@@ -283,7 +334,7 @@
     xcb_window_t indicator = 0;
     const struct callback_params params = {&indicator, &target, &direction, 
&drop_type};
 
-    drag_result_t drag_result = drag_pointer(con, event, XCB_NONE, BORDER_TOP, 
XCURSOR_CURSOR_MOVE, drag_callback, &params);
+    drag_result_t drag_result = drag_pointer(con, event, XCB_NONE, 
XCURSOR_CURSOR_MOVE, use_threshold, drag_callback, &params);
 
     /* Dragging is done. We don't need the indicator window any more. */
     xcb_destroy_window(conn, indicator);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/testcases/t/201-config-parser.t 
new/i3-4.21.1/testcases/t/201-config-parser.t
--- old/i3-4.21/testcases/t/201-config-parser.t 2022-09-21 20:12:41.000000000 
+0200
+++ new/i3-4.21.1/testcases/t/201-config-parser.t       2022-10-28 
13:46:28.000000000 +0200
@@ -552,6 +552,7 @@
         ipc_kill_timeout
         restart_state
         popup_during_fullscreen
+       tiling_drag
         exec_always
         exec
         client.background
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/testcases/t/318-i3-dmenu-desktop.t 
new/i3-4.21.1/testcases/t/318-i3-dmenu-desktop.t
--- old/i3-4.21/testcases/t/318-i3-dmenu-desktop.t      1970-01-01 
01:00:00.000000000 +0100
+++ new/i3-4.21.1/testcases/t/318-i3-dmenu-desktop.t    2022-10-28 
13:46:28.000000000 +0200
@@ -0,0 +1,125 @@
+#!perl
+# vim:ts=4:sw=4:expandtab
+#
+# Please read the following documents before working on tests:
+# • https://build.i3wm.org/docs/testsuite.html
+#   (or docs/testsuite)
+#
+# • https://build.i3wm.org/docs/lib-i3test.html
+#   (alternatively: perldoc ./testcases/lib/i3test.pm)
+#
+# • https://build.i3wm.org/docs/ipc.html
+#   (or docs/ipc)
+#
+# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
+#   (unless you are already familiar with Perl)
+#
+# Verifies that i3-dmenu-desktop correctly parses Exec= lines in .desktop files
+# and sends the command to i3 for execution.
+# Ticket: #5152, #5156
+# Bug still in: 4.21-17-g389d555d
+use i3test;
+use i3test::Util qw(slurp);
+use File::Temp qw(tempfile tempdir);
+use POSIX qw(mkfifo);
+use JSON::XS qw(decode_json);
+
+my $desktopdir = tempdir(CLEANUP => 1);
+
+$ENV{XDG_DATA_DIRS} = "$desktopdir";
+
+mkdir("$desktopdir/applications");
+
+# Create an i3-msg executable that dumps command line flags to a FIFO
+my $tmpdir = tempdir(CLEANUP => 1);
+
+$ENV{PATH} = "$tmpdir:" . $ENV{PATH};
+
+mkfifo("$tmpdir/fifo", 0600) or BAIL_OUT "Could not create FIFO: $!";
+
+open(my $i3msg_dump, '>', "$tmpdir/i3-msg");
+say $i3msg_dump <<EOT;
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use JSON::XS qw(encode_json);
+open(my \$f, '>', "$tmpdir/fifo");
+say \$f encode_json(\\\@ARGV);
+close(\$f);
+EOT
+close($i3msg_dump);
+chmod 0755, "$tmpdir/i3-msg";
+
+my $testcnt = 0;
+sub verify_exec {
+    my ($execline, $want_arg) = @_;
+
+    $testcnt++;
+
+    open(my $desktop, '>', "$desktopdir/applications/desktop$testcnt.desktop");
+    say $desktop <<EOT;
+[Desktop Entry]
+Name=i3-testsuite-$testcnt
+Type=Application
+Exec=$execline
+EOT
+    close($desktop);
+
+    # complete-run.pl arranges for $PATH to be set up such that the
+    # i3-dmenu-desktop version we execute is the one from the build directory.
+    my $exit = system("i3-dmenu-desktop --dmenu 'echo i3-testsuite-$testcnt' 
&");
+    if ($exit != 0) {
+       die "failed to run i3-dmenu-desktop";
+    }
+
+    chomp($want_arg);  # trim trailing newline
+    my $got_args = decode_json(slurp("$tmpdir/fifo"));
+    is_deeply($got_args, [ $want_arg ], 'i3-dmenu-desktop executed command as 
expected');
+}
+
+# recommended number of backslashes by the spec, not ambiguous
+my $exec_1 = <<'EOS';
+echo "hello \\$PWD \\"and\\" more"
+EOS
+my $want_1 = <<'EOS';
+exec  "echo \"hello \\$PWD \\\"and\\\" more\""
+EOS
+verify_exec($exec_1, $want_1);
+
+# permitted, but ambiguous
+my $exec_2 = <<'EOS';
+echo "hello \$PWD \"and\" more"
+EOS
+my $want_2 = <<'EOS';
+exec  "echo \"hello \\$PWD \\\"and\\\" more\""
+EOS
+verify_exec($exec_2, $want_2);
+
+# electrum
+my $exec_3 = <<'EOS';
+sh -c "PATH=\"\\$HOME/.local/bin:\\$PATH\"; electrum %u"
+EOS
+my $want_3 = <<'EOS';
+exec  "sh -c \"PATH=\\\"\\$HOME/.local/bin:\\$PATH\\\"; electrum \""
+EOS
+verify_exec($exec_3, $want_3);
+
+# complicated emacsclient command
+my $exec_4 = <<'EOS';
+sh -c "if [ -n \\"\\$*\\" ]; then exec emacsclient --alternate-editor= 
--display=\\"\\$DISPLAY\\" \\"\\$@\\"; else exec emacsclient 
--alternate-editor= --create-frame; fi" placeholder %F
+EOS
+my $want_4 = <<'EOS';
+exec  "sh -c \"if [ -n \\\"\\$*\\\" ]; then exec emacsclient 
--alternate-editor= --display=\\\"\\$DISPLAY\\\" \\\"\\$@\\\"; else exec 
emacsclient --alternate-editor= --create-frame; fi\" placeholder "
+EOS
+verify_exec($exec_4, $want_4);
+
+# permitted, but unusual to quote the first arg
+my $exec_5 = <<'EOS';
+"electrum" arg
+EOS
+my $want_5 = <<'EOS';
+exec  "\"electrum\" arg"
+EOS
+verify_exec($exec_5, $want_5);
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/i3-4.21/testcases/t/548-motif-hints.t 
new/i3-4.21.1/testcases/t/548-motif-hints.t
--- old/i3-4.21/testcases/t/548-motif-hints.t   1970-01-01 01:00:00.000000000 
+0100
+++ new/i3-4.21.1/testcases/t/548-motif-hints.t 2022-10-28 13:46:28.000000000 
+0200
@@ -0,0 +1,204 @@
+#!perl
+# vim:ts=4:sw=4:expandtab
+#
+# Please read the following documents before working on tests:
+# • https://build.i3wm.org/docs/testsuite.html
+#   (or docs/testsuite)
+#
+# • https://build.i3wm.org/docs/lib-i3test.html
+#   (alternatively: perldoc ./testcases/lib/i3test.pm)
+#
+# • https://build.i3wm.org/docs/ipc.html
+#   (or docs/ipc)
+#
+# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
+#   (unless you are already familiar with Perl)
+#
+# Test that setting and unsetting motif hints updates window decorations
+# accordingly, respecting user configuration.
+# Ticket: #3678
+# Ticket: #5149
+# Bug still in: 4.21
+use List::Util qw(first);
+use i3test i3_autostart => 0;
+use X11::XCB qw(:all);
+
+my $use_floating;
+sub subtest_with_config {
+    my ($style, $cb) = @_;
+    my $some_other_style = $style eq "normal" ? "pixel" : "normal";
+
+    subtest 'with tiling', sub {
+    my $config = <<EOT;
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+
+default_border $style
+default_floating_border $some_other_style
+EOT
+    my $pid = launch_with_config($config);
+    $use_floating = 0;
+    $cb->();
+    exit_gracefully($pid);
+    };
+
+    subtest 'with floating', sub {
+    my $config = <<EOT;
+# i3 config file (v4)
+font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
+
+default_border $some_other_style
+default_floating_border $style
+EOT
+    my $pid = launch_with_config($config);
+    $use_floating = 1;
+    $cb->();
+    exit_gracefully($pid);
+    };
+}
+
+sub _change_motif_property {
+    my ($window, $value) = @_;
+    $x->change_property(
+        PROP_MODE_REPLACE,
+        $window->id,
+        $x->atom(name => '_MOTIF_WM_HINTS')->id,
+        $x->atom(name => 'CARDINAL')->id,
+        32, 5,
+        pack('L5', 2, 0, $value, 0, 0),
+    );
+}
+
+sub open_window_with_motifs {
+    my $value = shift;
+
+    # we don't need other windows anymore, simplifies get_border_style
+    kill_all_windows;
+
+    my $open = \&open_window;
+    if ($use_floating) {
+        $open = \&open_floating_window;
+    }
+
+    my $window = $open->(
+        before_map => sub {
+            my ($window) = @_;
+            _change_motif_property($window, $value);
+        },
+    );
+
+    sync_with_i3;
+
+    return $window;
+}
+
+my $window;
+sub change_motif_property {
+    my $value = shift;
+    _change_motif_property($window, $value);
+    sync_with_i3;
+}
+
+sub get_border_style {
+    if ($use_floating) {
+        my @floating = @{get_ws(focused_ws)->{floating_nodes}};
+        return $floating[0]->{nodes}[0]->{border};
+    }
+
+    return @{get_ws(focused_ws)->{nodes}}[0]->{border};
+}
+
+sub is_border_style {
+    my ($expected, $extra_msg) = @_;
+    my $msg = "border style $expected";
+    if (defined $extra_msg) {
+        $msg = "$msg: $extra_msg";
+    }
+
+    local $Test::Builder::Level = $Test::Builder::Level + 1;
+    is(get_border_style($window), $expected, $msg);
+}
+
+###############################################################################
+subtest 'with default_border normal', \&subtest_with_config, 'normal',
+sub {
+$window = open_window_with_motifs(0);
+is_border_style('none');
+
+$window = open_window_with_motifs(1 << 0);
+is_border_style('normal');
+
+$window = open_window_with_motifs(1 << 1);
+is_border_style('pixel');
+
+$window = open_window_with_motifs(1 << 3);
+is_border_style('normal');
+
+cmd 'border pixel';
+is_border_style('pixel', 'set by user');
+
+change_motif_property(0);
+is_border_style('none');
+
+change_motif_property(1);
+is_border_style('pixel', 'because of user maximum=pixel');
+
+cmd 'border none';
+is_border_style('none', 'set by user');
+
+change_motif_property(0);
+is_border_style('none');
+
+change_motif_property(1);
+is_border_style('none', 'because of user maximum=none');
+};
+
+subtest 'with default_border pixel', \&subtest_with_config, 'pixel',
+sub {
+$window = open_window_with_motifs(0);
+is_border_style('none');
+
+$window = open_window_with_motifs(1 << 0);
+is_border_style('pixel');
+
+$window = open_window_with_motifs(1 << 1);
+is_border_style('pixel');
+
+$window = open_window_with_motifs(1 << 3);
+is_border_style('pixel');
+
+cmd 'border normal';
+is_border_style('normal', 'set by user');
+
+change_motif_property(0);
+is_border_style('none');
+
+change_motif_property(1);
+is_border_style('normal', 'because of user maximum=normal');
+};
+
+subtest 'with default_border none', \&subtest_with_config, 'none',
+sub {
+$window = open_window_with_motifs(0);
+is_border_style('none');
+
+$window = open_window_with_motifs(1 << 0);
+is_border_style('none');
+
+$window = open_window_with_motifs(1 << 1);
+is_border_style('none');
+
+$window = open_window_with_motifs(1 << 3);
+is_border_style('none');
+
+cmd 'border pixel';
+is_border_style('pixel', 'set by user');
+
+change_motif_property(0);
+is_border_style('none');
+
+change_motif_property(1);
+is_border_style('pixel', 'because of user maximum=pixel');
+};
+
+done_testing;

Reply via email to