Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tiling drag is too restricted #5797

Open
kolayne opened this issue Dec 2, 2023 · 3 comments
Open

Tiling drag is too restricted #5797

kolayne opened this issue Dec 2, 2023 · 3 comments

Comments

@kolayne
Copy link
Contributor

kolayne commented Dec 2, 2023

I'm submitting a…

[x] Bug
[ ] Feature Request
[ ] Documentation Request
[ ] Other (Please describe in detail)

Current Behavior

  • When there is a single tabbed container on a workspace and no windows outside of it, tiling drag doesn't work.
  • When a container other than a window (e.g. split or tabbed) is fullscreen, ttiling drag doesn't work.

Expected Behavior

  • When the only container on a workspace is a tabbed layout, it should still be possible to drag a window out of that container.
  • When a container with several descendant windows is fullscreen, moving windows around containers inside the fullscreen container should be possible.

Environment

Output of i3 --moreversion 2>&-:

Binary i3 version:  4.23-7-g69f68dcd © 2009 Michael Stapelberg and contributors
Running i3 version: 4.23-7-g69f68dcd (pid 916)
Loaded i3 config:
  /home/nikolay/.config/i3/config (main) (last modified: Sat 02 Dec 2023 20:01:26 HKT, 3366 seconds ago)

The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: i3

Config file
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!

set $mod Mod4

Font for window titles. Will also be used by the bar unless a different font

is used in the bar {} block below.

font pango:monospace 8

This font is widely installed, provides lots of unicode glyphs, right-to-left

text rendering and scalability on retina/hidpi displays (thanks to pango).

#font pango:DejaVu Sans Mono 8

The combination of xss-lock, nm-applet and pactl is a popular choice, so

they are included here as an example. Modify as you see fit.

xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the

screen before suspend. Use loginctl lock-session to lock your screen.

exec --no-startup-id xss-lock -- i3lock --nofork -k --inside-color ffffff --indicator -c 000077 --blur 10 -p default --keylayout 1 --pass-media-keys --pass-volume-keys --pass-screen-keys --pass-power-keys

(the above uses "i3lock-color")

Use pactl to adjust volume in PulseAudio.

set $refresh_i3status killall -SIGUSR1 i3status
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status

Set Alt as window drag key

floating_modifier Mod1

start a terminal

bindsym $mod+Return exec i3-sensible-terminal

kill focused window

#bindsym $mod+Shift+q kill
bindsym Mod1+F4 kill

start dmenu (a program launcher)

#bindsym $mod+d exec dmenu_run
bindsym Mod1+F2 exec --no-startup-id dmenu_run

There also is the (new) i3-dmenu-desktop which only displays applications

shipping a .desktop file. It is a wrapper around dmenu, so you need that

installed.

bindsym $mod+d exec --no-startup-id i3-dmenu-desktop

change focus

#bindsym $mod+j focus left
#bindsym $mod+k focus down
#bindsym $mod+l focus up
#bindsym $mod+colon focus right

alternatively, you can use the cursor keys:

bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

move focused window

#bindsym $mod+Shift+j move left
#bindsym $mod+Shift+k move down
#bindsym $mod+Shift+l move up
#bindsym $mod+Shift+colon move right

alternatively, you can use the cursor keys:

bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

split in horizontal orientation

bindsym $mod+h split h

split in vertical orientation

bindsym $mod+v split v

enter fullscreen mode for the focused container

bindsym $mod+f fullscreen toggle

change container layout (stacked, tabbed, toggle split)

bindsym $mod+s layout stacking
bindsym $mod+w layout tabbed
bindsym $mod+e layout toggle split

toggle tiling / floating

bindsym $mod+Shift+space floating toggle

change focus between tiling / floating windows

bindsym $mod+space focus mode_toggle

focus the parent container

bindsym $mod+a focus parent

focus the child container

bindsym $mod+Shift+a focus child

Define names for default workspaces for which we configure key bindings later on.

We use variables to avoid repeating the names in multiple places.

set $ws1 "1:Main"
set $ws2 "2"
set $ws3 "3"
set $ws4 "4"
set $ws5 "5"
set $ws6 "6"
set $ws7 "7"
set $ws8 "8:net"
set $ws9 "9:Messengers"
set $ws10 "10:Background"

Basic assignments

workspace $ws1 output eDP-1
workspace $ws9 output eDP-1
#workspace $ws10 output eDP-1

Assignments used for demonstrations

4 - slides control, 5 - terminal control;

6 - slides demo, 7 - terminal demo, 8 - obs preview.

#workspace $ws4 output eDP-1
#workspace $ws5 output eDP-1
#workspace $ws6 output HDMI-1-0
#workspace $ws7 output HDMI-1-0
#workspace $ws8 output HDMI-1-0

switch to workspace

bindsym $mod+1 workspace number $ws1
bindsym $mod+2 workspace number $ws2
bindsym $mod+3 workspace number $ws3
bindsym $mod+4 workspace number $ws4
bindsym $mod+5 workspace number $ws5
bindsym $mod+6 workspace number $ws6
bindsym $mod+7 workspace number $ws7
bindsym $mod+8 workspace number $ws8
bindsym $mod+9 workspace number $ws9
bindsym $mod+0 workspace number $ws10

move focused container to workspace

bindsym $mod+Shift+1 move container to workspace number $ws1
bindsym $mod+Shift+2 move container to workspace number $ws2
bindsym $mod+Shift+3 move container to workspace number $ws3
bindsym $mod+Shift+4 move container to workspace number $ws4
bindsym $mod+Shift+5 move container to workspace number $ws5
bindsym $mod+Shift+6 move container to workspace number $ws6
bindsym $mod+Shift+7 move container to workspace number $ws7
bindsym $mod+Shift+8 move container to workspace number $ws8
bindsym $mod+Shift+9 move container to workspace number $ws9
bindsym $mod+Shift+0 move container to workspace number $ws10

reload the configuration file

bindsym $mod+Shift+c reload

restart i3 inplace (preserves your layout/session, can be used to upgrade i3)

bindsym $mod+Shift+r restart

exit i3 (logs you out of your X session)

#bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'How would you like to exit?' -B 'Reboot' 'paplay /usr/share/sounds/freedesktop/stereo/service-logout.oga ; reboot' -B 'Shutdown' 'paplay /usr/share/sounds/freedesktop/stereo/service-logout.oga ; shutdown now' -B 'Exit i3' 'i3 exit'"

hibernate

bindsym $mod+Shift+h exec "i3-nagbar -t warning -m 'Hibernate?' -B 'Yes' 'systemctl hibernate'"

resize window (you can also use the mouse for that)

mode "resize" {
# These bindings trigger as soon as you enter the resize mode

    # Pressing left will shrink the window’s width.
    # Pressing right will grow the window’s width.
    # Pressing up will shrink the window’s height.
    # Pressing down will grow the window’s height.
    bindsym j resize shrink width 10 px or 10 ppt
    bindsym k resize grow height 10 px or 10 ppt
    bindsym l resize shrink height 10 px or 10 ppt
    bindsym semicolon resize grow width 10 px or 10 ppt

    # same bindings, but for the arrow keys
    bindsym Left resize shrink width 10 px or 10 ppt
    bindsym Down resize grow height 10 px or 10 ppt
    bindsym Up resize shrink height 10 px or 10 ppt
    bindsym Right resize grow width 10 px or 10 ppt

    # back to normal: Enter or Escape or $mod+r
    bindsym Return mode "default"
    bindsym Escape mode "default"
    bindsym $mod+r mode "default"

}

bindsym $mod+r mode "resize"

Start i3bar to display a workspace bar (plus the system information i3status

finds out, if available)

bar {
status_command i3status
font pango:monospace 12
}

tiling_drag modifier titlebar

Switch to last workspace

bindsym $mod+Tab workspace back_and_forth

Increase/decrease brightness (uses light from apt install light)

bindsym XF86MonBrightnessUp exec --no-startup-id light -A 10
bindsym XF86MonBrightnessDown exec --no-startup-id light -U 10

Play/pause media key

bindsym XF86AudioPlay exec --no-startup-id playerctl play-pause

BirdTray hotkey (not $mod but Mod4, intentionally)

bindsym Mod4+m exec --no-startup-id birdtray --toggle-tb

bindsym $mod+g exec chromium --new-window

Screenshot hotkeys

bindsym Print exec --no-startup-id flameshot screen --clipboard
bindsym Shift+Print exec --no-startup-id flameshot gui

Lock screen hotkey

bindsym $mod+l exec --no-startup-id loginctl lock-session

bindsym $mod+Shift+x exec --no-startup-id "sh -c \"if [ -f /tmp/CPU_extreme_mode ]; then cpu unextreme; else cpu extreme; fi\""

for_window [all] title_window_icon enable
for_window [title="Task Manager - (Brave|Google Chrome|Chromium)"] floating enable
for_window [class="gnome-calculator"] floating enable
for_window [class="Gnome-system-monitor"] floating enable
for_window [class="zoom"] floating enable

Thunderbird reminders: sticky and no focus stealing

for_window [title="\d+ Reminders?"] sticky enable
no_focus [title="\d+ Reminders?"]

Switch to the first workspace with the appropriate name

exec --no-startup-id i3-msg workspace $ws1

Startup applications

exec --no-startup-id pdeath_hup Docs/nvme_error_seaker.sh
exec --no-startup-id paplay /usr/share/sounds/Yaru/stereo/system-ready.oga
exec --no-startup-id pdeath_hup fusuma
exec --no-startup-id pdeath_hup clipster --daemon
exec --no-startup-id picom --config .config/picom.conf
exec --no-startup-id redshift-gtk
exec --no-startup-id cbatticon -l 15
#exec --no-startup-id birdtray

vk does not support startup id

#exec --no-startup-id vk --debug
#exec telegram-desktop
#exec --no-startup-id pdeath_hup Docs/Rimokon/rimokon_main.py

Change wallpaper and start slide show

(note: running it here instead of systemctl enable, as at the moment

of systemd start the X server display is not yet available)

exec --no-startup-id systemctl --user start switch_wallpaper.service

- Linux Distribution & Version: Arch Linux
- Are you using a compositor: yes, picom
@i3bot i3bot added the bug label Dec 2, 2023
@i3bot
Copy link

i3bot commented Dec 2, 2023

I don’t see a link to logs.i3wm.org. Did you follow https://i3wm.org/docs/debugging.html? (In case you actually provided a link to a logfile, please ignore me.)

@i3bot i3bot added missing-log Read the CONTRIBUTING.md file for instructions 4.23 labels Dec 2, 2023
@kolayne
Copy link
Contributor Author

kolayne commented Dec 2, 2023

The current behavior is the case since #5213. It was trying to solve #5184 but I'd argue the solution is wrong.

In my opinion, the behavior when no container is in fullscreen should have stayed exactly the same (let users drag out windows from the single container on a workspace); as for when there is a fullscreen container, the tiling drag should not be disabled completely. Instead, it should work with one of the following exceptions:

  • It is impossible to drag a window outside of the currently fullscreen container
  • Dragging a window out of the currently fullscreen container moves the window out (it's no longer visible) and focuses another window in the currently fullscreen container (e.g. layout H[A B C D], H focused, B is dragged out to the right, the new layout is H[H[A C D] B], the inner H remains focused, B is no longer visible).
  • Dragging a window out of the currently fullscreen container creates a new container, which adopts the old container and the dragged window and becomes fullscreen itself (e.g. layout H[A B C D], H focused, B is dragged out to the right, the new layout is H[H[A C D] B], the outer H gets focused, B is visible).

What do you think?

@orestisfl orestisfl added enhancement and removed bug missing-log Read the CONTRIBUTING.md file for instructions labels Dec 13, 2023
@orestisfl
Copy link
Member

Just to make sure I understand, the three options are mutually exclusive, right?

In that case, I think It is impossible to drag a window outside of the currently fullscreen container is the intuitively simpler option that I'd go for.

I am re-branding this as an enhancement as everything works as expected. Behavior can be less restricted but that would be an improvement, not a bug fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants