Commit graph

404 commits

Author SHA1 Message Date
MightyPlaza
b10cae3010
decos: groupbar mouse interaction (#3102)
* allow groupbar clicking
	modified:   src/Window.cpp
	modified:   src/Window.hpp
	modified:   src/managers/input/InputManager.cpp
	modified:   src/render/decorations/CHyprGroupBarDecoration.cpp
	modified:   src/render/decorations/CHyprGroupBarDecoration.hpp

* remove setting pos inside insertWindowToGroup()

modified:   src/Window.cpp
modified:   src/layout/DwindleLayout.cpp
modified:   src/layout/MasterLayout.cpp
modified:   src/managers/KeybindManager.cpp

* add group window by index and group size functions
modified:   src/Window.cpp
modified:   src/Window.hpp
modified:   src/managers/input/InputManager.cpp

* allow dragging into groupbar
modified:   src/Window.cpp
modified:   src/layout/DwindleLayout.cpp
modified:   src/layout/MasterLayout.cpp

* allow dragging from groupbar
modified:   src/managers/KeybindManager.cpp

* try groupbar clicking before border resize
modified:   src/managers/input/InputManager.cpp

* block grabbing groupbar on floating (crash)

remove later when crashing is fixed

modified:   src/managers/KeybindManager.cpp

* remove redundant { }
modified:   src/layout/DwindleLayout.cpp
modified:   src/layout/MasterLayout.cpp

* implement getWindowDecorationBox()
modified:   src/Window.cpp
modified:   src/Window.hpp
modified:   src/layout/DwindleLayout.cpp
modified:   src/layout/MasterLayout.cpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/input/InputManager.cpp
modified:   src/render/decorations/CHyprDropShadowDecoration.cpp
modified:   src/render/decorations/CHyprGroupBarDecoration.cpp
modified:   src/render/decorations/IHyprWindowDecoration.cpp
modified:   src/render/decorations/IHyprWindowDecoration.hpp

* fix crash when moveoutofgroup in floating windows

also removes dragging from floating windows limitation

modified:   src/layout/IHyprLayout.cpp
modified:   src/managers/KeybindManager.cpp

* use CRegion in getWindowDecorationBox()
modified:   src/helpers/Region.cpp
modified:   src/helpers/Region.hpp
modified:   src/layout/DwindleLayout.cpp
modified:   src/layout/MasterLayout.cpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/input/InputManager.cpp
modified:   src/render/decorations/IHyprWindowDecoration.cpp
modified:   src/render/decorations/IHyprWindowDecoration.hpp

* add groupbar scrolling
modified:   src/config/ConfigManager.cpp
modified:   src/managers/input/InputManager.cpp

* change name to getWindowDecorationRegion()
modified:   src/layout/DwindleLayout.cpp
modified:   src/layout/MasterLayout.cpp
modified:   src/managers/KeybindManager.cpp
modified:   src/managers/input/InputManager.cpp
modified:   src/render/decorations/IHyprWindowDecoration.cpp
modified:   src/render/decorations/IHyprWindowDecoration.hpp

* make dragging from group less hacky for floating
modified:   src/managers/KeybindManager.cpp
2023-08-30 17:39:22 +02:00
vaxerski
870471dd96 internal: allow opening empty special workspaces
Fixes point 2 of #2596
2023-08-25 18:05:08 +02:00
memchr
f0da0b0be4
input: improved path handling; null check return value of fopen. (#3061) 2023-08-25 17:21:55 +02:00
vaxerski
6a5a5ed11e input: add transparent binds
adds a new flag for binds to be transparent (non-shadowable)
fixes #3058
2023-08-25 12:35:24 +02:00
memchr
63b266cf65
internal: ioctl use /dev/tty instead of fd 0 for VT_GETSTATE (#2989)
* fix: ioctl use /dev/tty instead of fd 0 for VT_GETSTATE

ioctl VT_GETSTATE on stdin fails if it is not console, such as when
using GDM.  `/dev/tty` should be used instead.

- `/dev/tty` is a synonym for the controlling terminal of a process, if
there is one.

---------

Co-authored-by: Jan Beich <jbeich@FreeBSD.org>
2023-08-16 10:51:08 +02:00
UserSv4
8a7ce59ad4
internal: Fix grouped windows not being properly focused on activation (#2925)
* Fix grouped windows not being properly focused on activation

This bug could happen if you:
1. Open two Chromium windows in a single group
2. Open some tabs in both of the windows
3. Using tabs search (Ctrl+Shift+A) try to switch to a tab in the second window from the first one.
When this happens any window focus would be lost (hyprctl activewindow starts to output "Invalid") and also the mouse cursor would become centered relatively to the second window.

* Update Compositor.cpp
2023-08-11 17:27:09 +02:00
MightyPlaza
901236a535
rules: center window improvements (#2935)
* center window improvements
	modified:   src/config/ConfigManager.cpp
	modified:   src/events/Windows.cpp
	modified:   src/managers/KeybindManager.cpp

* remove redundant line
	modified:   src/events/Windows.cpp

* simplify code
	modified:   src/events/Windows.cpp
	modified:   src/managers/KeybindManager.cpp
2023-08-11 16:54:16 +02:00
MightyPlaza
6295cbe9cb
keybinds: Keep aspect ratio (#2907) 2023-08-08 18:52:20 +02:00
Michael
ad3b8dddf9
keybinds: Only call fclose() when we have a valid file. (#2908)
Signed-off-by: Michael Pacheco <git@michaelpacheco.org>
2023-08-08 16:07:15 +02:00
Michael
cebab759d5
Close keymap files. Fixes #2904 (#2905)
Signed-off-by: Michael Pacheco <git@michaelpacheco.org>
2023-08-07 19:34:15 +02:00
vaxerski
08651736ad keybinds: add toggle to dpms 2023-07-30 16:46:37 +02:00
memchr
76c6e09e39
keybinds: Make moveintogroup locking check configurable (#2796)
* groups: revert to the old moveintogroup behaviour, ignore m_sGroupData.locked

* groups: Make moveintogroup locking check configurable
2023-07-24 18:25:10 +02:00
MightyPlaza
ca54ceff6f
groups: add use_current_group_pos (#2759) 2023-07-20 19:48:32 +02:00
MightyPlaza
3b03597784
keybinds: movegroupwindow-improvement (#2740)
* movegroupwindow-improvement

* use std::swap
2023-07-19 00:30:10 +02:00
István Donkó
5c8a20be77
fix: handle window change directions in fullscreen (#2728) 2023-07-18 12:12:50 +02:00
Lennard Hofmann
06f5910365
Make bind modmask case-insensitive (#2714) 2023-07-14 18:39:53 +02:00
MightyPlaza
db2367bf33
update groub decos (#2705) 2023-07-13 20:17:14 +02:00
vaxerski
9f7382bca4 keybinds: add movegroupwindow 2023-07-13 17:55:25 +02:00
Daniel Adolfsson
d3a644d81c
Dwindle: Make resize more intuitive (#2681)
* improved resize

* clang-format

* rewrite

* almost legacy behavior when using CORNER_NONE
2023-07-13 16:52:11 +02:00
MightyPlaza
50755d26d4
lockgroups fix (#2636) 2023-07-03 15:53:04 +02:00
MightyPlaza
05047f60f4
groupbar fixes (#2630)
Fixes multiple groupbar decoration issues:

  -  togglegroup removes fullscreen to avoid to avoid weird state
 -   fixes issue where a group had multiple windows with head = true
 -   fixes issue where merging 2 groups would cause a window to have 2 groupbar decorations
  -  fixes issue where merging a group with more than 1 window into another group would make windows have no groupbar decoration
  -  fixes issue where ungrouping windows could just move them into another group on the same workspace


---------

Co-authored-by: vaxerski <43317083+vaxerski@users.noreply.github.com>
2023-07-03 12:49:56 +02:00
fc59cef1ee keybinds: remove old todo 2023-06-21 21:20:26 +02:00
cabdf38ce4 internal: minor style fixes 2023-06-20 21:35:54 +02:00
outfoxxed
f0e4f6622e
Implement pass binds (#2503)
* Implement pass binds

Pass binds run the associated dispatcher but do not prevent windows
from receiving the bind.

* Fix pass binds not working properly with release binds

* Rename `pass` to `nonConsuming`
2023-06-14 13:08:56 +02:00
memchr
24ed9b061f
feat: add variable to customize locked group border color (#2507)
added variables:
- general:col.group_border_locked
- general:col.group_border_locked_active
2023-06-13 12:04:54 +02:00
memchr
bca3068db2
feat: add lockactivegroup dispatcher (#2478)
* feat: add lockactivegroup dispatcher

The `lockactivewindow` dispatcher takes `lock`, `toggle` or `unlock` as arguments. When a group is locked, no window or group can be added to it, nor can it be added to another group, but the `moveintogroup` and `moveoutofgroup` dispatches are not affected.

Implementation details:

the lock is implement via `SGroupData.locked` flag (defaults to false).

The flag is only relevant to the group head, and upon the group head's succession, the flag will be passed down to the new head. Meanwhile, the old head's flag will be set to false.

The flag is set to false when a group is dismissed.

New condition checks have been added to the dwindle and master layout to check if target group is unlocked (and if the source is also a group and unlocked) before adding windows to the target group.

* refactor: `lockactivegroup dispatcher code ordering
2023-06-09 23:44:18 +02:00
cf37922d42 input: update surface input on changeworkspace 2023-06-09 12:20:40 +02:00
staz
e4e6ddb075
Make movetoworkspace register previous workspace (#2436)
* Make movetoworkspace register previous workspace

* style: no braces + format with clang-format
2023-06-05 09:44:13 +02:00
baf81cdc5d input: force focus on movefocus 2023-05-31 20:59:38 +02:00
vaxerski
a7cfbdb854 keybinds: fix tryMoveFocusToMonitor with special 2023-05-29 18:11:37 +02:00
Jeremy Huang
b3a86952cf
focus: fix #1675 window not scrollable after movefocus (#2390) 2023-05-29 09:52:36 +02:00
Jeremy Huang
8afc2f45c7
focus: make cursor follow movewindow (#2374) 2023-05-27 12:16:50 +02:00
vaxerski
eb1f832fce decos: recalc on add 2023-05-23 14:26:38 +02:00
vaxerski
088b4a68e6 moveActiveToWorkspace: update last window of old ws 2023-05-22 19:44:10 +02:00
Anthony Ruhier
9ef7225532
don't swap workspaces if monitors are the same (#2322)
Return swapActiveWorkspaces early if MON1 and MON2 are equals, to avoid
buggy behavior.
2023-05-17 13:31:03 +01:00
vaxerski
824813fc6a internal: remove check for negative exact vector args 2023-05-15 15:16:06 +01:00
vaxerski
79791c9ed4 internal: fix -Wsign-compare and -Wunused-variable warnings 2023-05-02 14:53:31 +01:00
vaxerski
45b1e6dc5e keybinds: simulate workspace switch on focusWindow to another ws 2023-05-01 15:39:08 +01:00
vaxerski
4a1fb3e903 keybinds: fix move to named 2023-04-26 16:58:58 +01:00
mekb
fbcbe947da
Added moveCursor dispatcher (#2100)
* Added moveCursor dispatcher

* fix error message for moveCursor
2023-04-23 19:50:53 +01:00
vaxerski
b15803510c input: improve mouse release conditions 2023-04-20 00:46:42 +01:00
vaxerski
b6a7be7663 dispatchers: fix movetoworkspace with bound ws-es 2023-04-17 16:09:46 +01:00
vaxerski
785fc8d669 dispatchers: fix missing log param 2023-04-17 13:30:37 +01:00
vaxerski
f80f4f3194 dispatchers: fix named ws-es on changeworkspace 2023-04-16 21:32:32 +01:00
vaxerski
d6c4ae71d0 damage: fix damage on moves / workspace changes 2023-04-15 16:16:33 +01:00
vaxerski
83f1616a65 keybinds: minor adjustments to workspace 2023-04-14 17:51:10 +01:00
vaxerski
7ec23254fd workspace: don't lose monitor with refocus on no warps 2023-04-14 17:03:12 +01:00
vaxerski
c2b5dd1be6 keybinds: only warp on different monitor ws 2023-04-14 16:22:55 +01:00
vaxerski
727160f0a4 workspaces: fixup workspaces not activating on workspace switch 2023-04-14 15:28:22 +01:00
vaxerski
3f2a18a435 keybinds: remove old comment 2023-04-14 15:16:59 +01:00
vaxerski
cf7c5e4dff misc: fix a warning 2023-04-14 15:06:22 +01:00
vaxerski
287e6c4ede internal: workspace manip handling rework 2023-04-14 15:03:53 +01:00
vaxerski
011600ac6e keybinds: more intelligent fallback on silent move 2023-04-14 01:42:55 +01:00
vaxerski
260ef788f5 internal: don't sanity check workspaces on internal ws calls 2023-04-13 22:21:11 +01:00
vaxerski
6131e0bef7 keybinds: refocus properly on silent move 2023-04-13 22:20:31 +01:00
Max Verevkin
c2f29be9ba
make ext_workspace_unstable impl more atomic (#2023) 2023-04-11 14:28:32 +01:00
vaxerski
16a034a34a keybinds: send pass with a null keymap 2023-04-10 22:42:05 +01:00
Hilmar Wiegand
7b43f9f056
Implement window move (#2018) 2023-04-10 20:07:49 +01:00
vaxerski
56a307d734 Revert "keybinds: avoid sending release on suppressed press"
Issues with XWayland

This reverts commit a1b1480c21.
2023-04-10 15:47:20 +01:00
Hilmar Wiegand
6a4bda60f2
Allow movefocus for empty workspaces (#2011)
* Allow switching to empty workspaces using movefocus

* Allow switching to other workspaces when no windows are focused

* Implement review feedback

* Add option to disable focus fallback

* Remove unnecessary braces
2023-04-10 14:40:03 +01:00
vaxerski
a1b1480c21 keybinds: avoid sending release on suppressed press 2023-04-10 00:56:08 +01:00
Vaxry
046ad79d11
GlobalShortcuts protocol impl (#1886)
Implements the `hyprland-global-shortcuts-v1` protocol

---------

Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
2023-04-09 13:48:20 +01:00
vaxerski
80650b6722 keybinds: allow MOD1 as an alias of ALT 2023-04-06 19:28:09 +01:00
Jan Beich
16bc5997bb
Misc FreeBSD fixes (#1926)
* helpers: drop incomplete GNU/kFreeBSD bits

Debian with FreeBSD kernel lacks Wayland-related packages and is not
officially supported since Jessie.

* KeybindManager: check VT ioctl availability instead of hardcoding

* plugins: add missing header for libc++ after 430778293e

src/plugins/PluginAPI.cpp:299:33: error: implicit instantiation of undefined template 'std::basic_istringstream<char>'
    std::istringstream          inStream(SYMBOLS);
                                ^
/usr/include/c++/v1/iosfwd:140:32: note: template is declared here
    class _LIBCPP_TEMPLATE_VIS basic_istringstream;
                               ^

* plugins: prefer llvm-nm with Clang after 430778293e

nm: invalid option -- j
2023-03-31 20:39:04 +01:00
Alexander Seiler
60527ab180
Fix some typos (#1907)
Signed-off-by: Alexander Seiler <seileralex@gmail.com>
2023-03-29 23:44:25 +01:00
6fec5bfbeb keybinds: improve movefocus on fullscreen 2023-03-27 15:19:27 +01:00
Vaxry
788a8f7c13
internal: wrap wlr surfaces (#1822) 2023-03-20 15:00:58 +00:00
vaxerski
7a514f41a3 Focus: warp cursor on movewindow 2023-03-20 01:42:21 +00:00
vaxerski
2ba5238b8e groups: fix moving between displays 2023-03-18 16:30:29 +00:00
vaxerski
606cb2832a keybinds: remember last workspace on focusmonitor 2023-03-16 16:40:28 +00:00
vaxerski
5d44ea802a monitors: guard output when read 2023-03-16 14:03:40 +00:00
vaxerski
e749af7b60 dispatchers: remember named workspaces in prev 2023-03-13 15:19:25 +00:00
vaxerski
bcd8fe9573 groups: add deco on moveIntoGroup 2023-03-13 00:47:57 +00:00
vaxerski
71ef1bde7e dispatchers: disallow togglesplit on fullscreen 2023-03-11 17:58:34 +00:00
vaxerski
489ef7c51c add toggle group lock 2023-03-02 20:50:37 +00:00
ac251d7a66 allow focus to grouped windows 2023-02-28 12:34:59 +00:00
vaxerski
18ed73f091 Added moveoutofgroup dispatcher 2023-02-26 13:55:35 +00:00
vaxerski
55b412e0f4 Added moveintogroup dispatcher 2023-02-26 13:52:11 +00:00
Ryan Dwyer
3bfaeacf7d
movefocus: Set new workspace as active when focusing new monitor (#1640) 2023-02-26 13:44:11 +00:00
vaxerski
1089e858b4 fix changegroupactive back 2023-02-24 17:24:51 +00:00
60e37d727d fix cyclenext on empty focus 2023-02-23 14:27:43 +00:00
14a2de0d0e add mouse_left _right 2023-02-23 13:55:27 +00:00
a66ef50469 added a lockgroups dispatcher 2023-02-21 12:13:41 +00:00
vaxerski
df2956b411 ignore hidden in allfloat 2023-02-19 22:14:37 +00:00
Vaxry
e5a4c0c986
Group/Tab Rework (#1580) 2023-02-19 21:07:32 +00:00
Vaxry
1b56cc4e99
Added an Event Hook System (#1578)
* added an eventHookSystem

* Add all socket2 events to hooks
2023-02-19 20:54:53 +00:00
vaxerski
6e16627cbc Added execr 2023-02-19 13:59:47 +00:00
Ching Pei Yang
c92e0c05e4
Resize on border (#1347) 2023-02-18 22:35:31 +00:00
nub
98c95aa34d
focusCurrentOrLast dispatcher (#1545) 2023-02-14 00:46:58 +00:00
vaxerski
32381fe6c4 send a 1 on unknown minimize event 2023-01-29 17:02:55 +00:00
Jan Beich
c3adc9ec56
Get active VT via ioctl instead of sysfs after e90c5c6347 (#1448) 2023-01-29 12:44:38 +00:00
Cyril Levis
fcbfd19393
feat: add focus to urgent or last window (#1402)
* feat: add focus to urgent or last window

* Rename dispatcher

Co-authored-by: Maxim Baz <git@maximbaz.com>
2023-01-21 11:18:55 +01:00
devil-may-c0de
6a56d1e4d0
change placement of isSwitchingToPrevious (#1388)
fixes #1218, but doesn't break functionality of allow_workspace_cycles.
2023-01-16 21:04:10 +01:00
9c77415cda damage monitor on moveactive 2023-01-13 12:31:24 +01:00
Raffaele Mancuso
c0c7c12bb9
Pin dispatcher for a specific window (#1340)
Closes #1339
2023-01-08 18:37:24 +01:00
riChar
e5dcbf73d8
Add "on" and "off" for the bind of switch (#1342) 2023-01-08 16:35:24 +01:00
Cyril Levis
3173fbdc4a
feat: dispatcher, add workspace renaming (#1336)
* feat: dispatcher, add workspace renaming

Co-authored-by: vaxerski <vaxry@vaxry.net>
2023-01-08 14:19:18 +01:00
461fab0f27 minor fixes for fakefullscreen 2023-01-06 13:29:49 +01:00
96198dae55 Normalize color storage
Colors are now normalized to 0 - 1 values instead of 0 - 255

causes calculations to be simpler and generally cleans up the codebase.
2023-01-05 19:25:45 +01:00
cb4f748226 added fakefullscreen 2023-01-01 16:54:13 +01:00