Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'vanilla/stable' into gaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Airblader committed Oct 28, 2022
2 parents 3924e7b + 85252a3 commit 787bee6
Show file tree
Hide file tree
Showing 32 changed files with 635 additions and 140 deletions.
74 changes: 0 additions & 74 deletions RELEASE-NOTES-4.21

This file was deleted.

44 changes: 44 additions & 0 deletions RELEASE-NOTES-4.21.1
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions docs/userguide
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ provided by the i3 https://github.com/i3/i3/blob/next/etc/config.keycodes[defaul

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
Expand Down Expand Up @@ -1402,6 +1403,29 @@ fullscreen toggle
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
Expand Down
4 changes: 4 additions & 0 deletions etc/config
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ set $right semicolon
# 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

Expand Down
4 changes: 4 additions & 0 deletions etc/config.keycodes
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOU
# 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

Expand Down
20 changes: 16 additions & 4 deletions i3-dmenu-desktop
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ my $exec = $app->{Exec};
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;
Expand All @@ -425,6 +425,17 @@ $choice = quote($choice);
$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;

Expand Down Expand Up @@ -481,9 +492,10 @@ EOT
# 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';
Expand Down
2 changes: 1 addition & 1 deletion include/con.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ int con_border_style(Con *con);
* 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
Expand Down
1 change: 1 addition & 0 deletions include/config_directives.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ CFGFUN(assign, const char *workspace, bool is_number);
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);
Expand Down
3 changes: 3 additions & 0 deletions include/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include "queue.h"
#include "i3.h"
#include "tiling_drag.h"

typedef struct IncludedFile IncludedFile;
typedef struct Config Config;
Expand Down Expand Up @@ -266,6 +267,8 @@ struct Config {
/* The number of currently parsed barconfigs */
int number_barconfigs;

tiling_drag_t tiling_drag;

/* Gap sizes */
gaps_t gaps;

Expand Down
17 changes: 14 additions & 3 deletions include/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ typedef enum { NO_ORIENTATION = 0,
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 */
Expand Down Expand Up @@ -743,7 +745,16 @@ struct Con {
* 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
Expand Down
21 changes: 20 additions & 1 deletion include/tiling_drag.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 1 addition & 1 deletion man/i3-config-wizard.man
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ used.

== 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.

Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 13 additions & 0 deletions parser-specs/config.spec
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ state INITIAL:
'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
Expand Down Expand Up @@ -362,6 +363,18 @@ state POPUP_DURING_FULLSCREEN:
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
Expand Down
1 change: 1 addition & 0 deletions release-notes/bugfixes/1-motifs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
motif hints: respect maximum border style configuration set by user
1 change: 1 addition & 0 deletions release-notes/bugfixes/2-focus-click
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tiling drag: allow click immediately, to focus on decoration click
1 change: 1 addition & 0 deletions release-notes/bugfixes/3-drag-cursor
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix tiling drag cursor: should be “move”, accidentally was “top right corner”
1 change: 1 addition & 0 deletions release-notes/bugfixes/4-drop-scratchpad
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tiling drag: ignore scratchpad windows when locating drop targets
1 change: 1 addition & 0 deletions release-notes/changes/1-tiling-drag
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tiling drag is now configurable, and defaults to “modifier” for existing configs
1 change: 1 addition & 0 deletions release-notes/changes/2-tiling-drag-targets
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tiling drag: only initiate when there are drop targets

0 comments on commit 787bee6

Please sign in to comment.