Commit Graph

616 Commits

Author SHA1 Message Date
Vaxry 5edc32930d layerSurface: refactor/move to a memory-safe impl
Makes all the pointers smart to avoid memory issues
Refactors layerSurface code to live inside desktop/layersurface
2024-04-30 02:41:27 +01:00
Vaxry 33e0bb1478 wlr-output-power: move to new impl 2024-04-29 01:38:24 +01:00
Vaxry bca7804bb6
internal: Window storage rework - part 1 (#5762)
* Window storage rework - part 1

* format

* remove useless include

* fix pch

* format

* fix crash in dwindle

* fix vram leak

* prefer .expired() for bool checks
2024-04-27 12:43:12 +01:00
Vaxry 25aec3ac8c pointer-constraints: move to new impl 2024-04-27 03:17:04 +01:00
Vaxry 01df3b73d8 shortcuts-inhibitor: move to new impl 2024-04-25 14:32:35 +01:00
Agent00Ming 81bb4eb2f6
workspace: Fix duplication of "special:" in special workspace name (#5729)
* Fix duplication of "special:" in special workspace name
	modified:   src/desktop/Workspace.cpp

* Track default special workspace name as special:special
This is to fix the edge cases with the previous commit without breaking
user configs.

	modified:   src/helpers/MiscFunctions.cpp

---------

Co-authored-by: Agent_00Ming <agent00ming9366@gmail.com>
2024-04-24 16:07:22 +01:00
Gabriel Ford c3ec16f494 config: Add More Monitor 'Auto' Positions. (#5670)
* Reverse Window Positioning.

* Cleanup old comments and logs.

* Finish Splitting Left and Right offset.

* Forgot to add Auto Left to ConfigManager

* Fix problems with auto_left.

* Nearly finish up and down.

* Finish draft of all four dirs. Testing now.

* Change Y value in moveTo for up and down.

* Format, comment, and cleanup.

* Address Vaxry's feedback.

* Add check to see if auto position is first rule.

* Run clang-format.
2024-04-23 01:49:25 +01:00
Vaxry 741c75d907 gamma-control: move to new impl 2024-04-22 18:21:03 +01:00
Vaxry d9fe1d0f58 idle-inhibit: move to new impl 2024-04-21 16:54:52 +01:00
Vaxry e823b5d693 Window: add destroy signal 2024-04-21 16:54:50 +01:00
Vaxry a141bbbea5 helpers: Add new C++ Signal and Listener classes
A memory-safe alternative to wl_signal
2024-04-21 01:47:45 +01:00
Vaxry 4ad739ec63 HookSystem: improve callback safety 2024-04-20 20:16:42 +01:00
Yaroslav a945346064
core: remove libsystemd dependency (#5660)
* remove libsystemd dependency

as per Lennart Poettering's advice:
https://github.com/systemd/systemd/issues/32028#issuecomment-2031366922

* fix naming for systemd helper functions

* rename vars according to code style

* Nix: update meson patch

---------

Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
2024-04-20 18:50:07 +01:00
Vaxry b52a49b4c4
tearing-control: hyprland impl (#5655)
* tearing: hl impl

* format
2024-04-19 22:16:35 +01:00
thejch d96501442f
core: Fix double special workspace (#5574)
* fix double special name

* fix special on another monitor

* remove extra stuff
2024-04-13 14:39:20 +01:00
Vaxry b1a9430289 inhibitor: always destroy on window unmap
ref #5555
2024-04-12 00:18:58 +01:00
TheOnlyMrCat 47e5b41fea
renderer: Add dimaround layer rule (#4643) 2024-04-11 12:41:18 +01:00
Vaxry b573c20125 monitor: add workspace null check to visible flag
ref #5524
2024-04-10 17:21:45 +01:00
MightyPlaza df1a3a978d
input: don't remove pinned focus on workspace change (#5486)
modified:   src/helpers/Monitor.cpp
2024-04-07 23:13:56 +01:00
Vaxry b5b1c0137d CColor: fix getAsHex 2024-04-05 21:23:06 +01:00
Vaxry 4909b0f350 monitor: unset visible flag from ws on disconnect
ref #5443
2024-04-05 19:25:40 +01:00
Vaxry 0051b078a1 monitor: check for invalid workspaces in onConnect
ref #5443
2024-04-05 16:57:49 +01:00
end-4 9b8ef9206d
layers: separate anim configs for open/close (#5421) 2024-04-04 16:41:09 +01:00
Vaxry 347b839034 workspaces: add visible flag 2024-04-03 10:09:48 +01:00
Vaxry ef23ef60c5
Workspace/core: Refactor workspace storage (#5380)
* refactor workspaces to use ptrs

* clang-format
2024-04-02 20:32:39 +01:00
Vaxry 9e8f051896 avar: minor fixes 2024-03-31 21:43:08 +01:00
Vaxry 64c8ba2fb1 avar: fix warp onEnd conditions
ref #5348
2024-03-31 21:34:11 +01:00
thejch 16a9c16d9f
renderer/animations: Fix various inaccurate damage tracking issues and offsets (#5297) 2024-03-31 02:14:26 +01:00
Vaxry 2930c5cb6f animvar: fixup update callbacks and cleanup 2024-03-29 00:23:23 +00:00
MightyPlaza 647d5a4ffc
layers: fix bottom slide animation (#5307)
modified:   src/helpers/WLClasses.cpp
2024-03-28 14:14:27 +00:00
Vaxry 132ab8d035 layers: add animation direction overrides
fixes #5285
2024-03-28 01:39:29 +00:00
Vaxry a9d7526aae core: ensure m_pLastMonitor validity over unsafe state
ref #5241
2024-03-26 02:26:19 +00:00
Vaxry ae17e900e7 layer-shell: render popups above everything 2024-03-25 16:20:30 +00:00
Vaxry ca17a89d86 renderer: allow blurring ls popups 2024-03-25 16:09:02 +00:00
Vaxry 5cc4bf699c IME: Refactor and fixup popups 2024-03-24 16:08:25 +00:00
thejch c7fbea3368
animations: Fix animation issue in focusworkspaceoncurrentmonitor (#5202)
* dont render when workspace offset

* add guard

* can remove useless code now if workspace offset is not taken into account

* clang-format

* when special workspace is moved, set anim to move

* add offset back

* make it a configurable option because some folks apparently can't align their monitors correctly and may not want this feature😔

* remove config option
2024-03-23 22:14:50 +00:00
Khalid 059e85ae69
input: Add options to set tablet's active area (#5199)
* Add options to set tablet's active area

* Set tablet's active area in `setTabletConfigs`

* Fix formatting for new variables in ConfigManager

* Report tablet's physical size with hyprctl
2024-03-23 20:31:03 +00:00
Vaxry 9f2ed02f35 IME/TI: Fixes and refactoring
Fixes #5189
2024-03-22 23:08:52 +00:00
Vaxry d2b42e29c6 IME: fix crashes with destroyed text-inputs
ref #5189
2024-03-22 18:45:28 +00:00
Vaxry 8593c45be3 refactor: move window.hpp to desktop/ 2024-03-20 01:44:51 +00:00
joshua 5c1097cbc1
IME: Improve handling of text-input and ime-relay (#5147)
* input: Handling multiple surfaces for the text-input-v1 protocol implementation and imporve InputMethodRelay logic

fixes #2708

* clang-format

* minor style nits

---------

Co-authored-by: Vaxry <vaxry@vaxry.net>
2024-03-19 15:54:33 +00:00
Vaxry 4ffcdc41ff animations: fix layer slide with fade
fixes #5151
2024-03-18 18:29:57 +00:00
Zach DeCook 3c21f5e07b
swipe: Touchscreen workspace swipe (#4489)
* Workspace Swipe: Refactor update and end functions

* Touch: Implement workspace swipe better

ignoring additional fingers and new touches

allow gaps-right and gaps-left to be different
2024-03-17 15:43:59 +00:00
Vaxry e68c07d809 renderer: don't render window on other mons during anim in
fixes #5139
2024-03-17 01:05:26 +00:00
thejch c942ce6dce
renderer: add better multi monitor animations (#5126) 2024-03-16 14:49:34 +00:00
Vaxry 3f5f5f5491 splashes: add 2ya splash 2024-03-15 23:58:22 +00:00
Vaxry 2ed032a7fd xwayland: fix no_xwayland compiles 2024-03-09 22:37:49 +00:00
Vaxry c3882bb832
internal: Support libhyprcursor (#5009)
woo

---------

Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
2024-03-09 16:52:59 +00:00
Vaxry 0a4ade01d3 format: make ci happy 2024-03-08 17:40:28 +00:00
Aaron 5920c6a6b8
socket2: Add 5 IPC event with support for workspace ID (#5022)
- `moveworkspacev2`:    returns workspaceID,workspaceName,monitorName
- `movewindowv2`:       returns windowAddress,workspaceID,workspaceName
- `createWorkspacev2`:  returns workspaceID,workspaceName
- `destroyWorkspacev2`: returns workspaceID,workspaceName
- `workspacev2`:        returns workspaceID,workspaceName

- Include workspaceID as a parameter in CWorkspace constructor to support `createWorkspacev2`.

Resolves #4929
2024-03-08 17:39:53 +00:00
Epilepsy Gatherings e52d3fa852
windowrules: Make min/maxsize rules dynamic (#4775)
* rebase

* simplify and remove prop

* Stuff

- add back win prop
- change minsize defaults
- change request formatting for setprop

* style fix

* remove empty line

* change defaults

* redo string to vec

* remove redundant parsing

* change to vec

* support commas

* remove static rules

* take out garbage

* format

* don't allow commas and resize on setprop

* use isNumber
2024-03-08 02:24:44 +00:00
thejch 6c4e2489a0
layout: Fix toggling fullscreen special workspace on different monitor (#5000)
* fix toggling fullscreen special ws on different monitor

* add for dwindle

* fix change regular workspace when special fullscreen
2024-03-07 13:27:58 +00:00
outfoxxed d6f1b151b2
animations: fix m_Goal not being set after #4911 (#4992) 2024-03-06 10:14:13 +00:00
Junxuan Liao 08152477dc
monitor: remove commas from short description (#4970)
Since `hyprctl monitor` shows szShortDescription now, it needs to be sanitized.
(See #2457)

Also, monitor selectors are now compared against szShortDescription and
szDescription to avoid re-striping the string.
2024-03-05 13:41:51 +00:00
thejch 9c48c322d4
keybinds: Allow fullscreen/maximize in special workspace (#4921)
* allow fullscreen/maximize in special workspace

* remove duplicate code

* hide top layer

* fix special fullscreen deco

* edit

* fix fade top layer when toggle special

* remove double render
2024-03-04 23:29:45 +00:00
Vaxry 063708df26 config: improve config value infrastructure 2024-03-03 18:41:38 +00:00
Vaxry c701767038 xkb: handle invalid keymaps in updateXKBTranslationState
fixes #4941
2024-03-03 17:02:15 +00:00
Vaxry d72ea5f2a7
input: Rewritten pointer constraints (#4889)
* rewritten constraints

* send pointer enter on activate if not pointer focus

* minor cleanup

* simulate movement on commit

* don't ignore oneshot prop

* various fixes

* dont send motion on confined

* update pos hint on region change
2024-03-02 21:04:55 +00:00
Vaxry 7ce781e87c keybinds: better follow xkb translation state
fixes #4908
2024-03-02 01:46:55 +00:00
GartoxFR b2c3440477
animations: Refactor AnimatedVariable (#4911)
* animation: Refactor AnimatedVariable

This commit decomposes the AnimatedVariable class into a base class
with the common attribute to all variable types and a templated derived
type containing strongly typed info on the type being animated.

Access to the typed version is perfomed using the visitor pattern. A
utility is provided to build a visitor on the fly using lambdas.

Adding a new type to be animated should just be a matter of adding the
typed in the list defined by the ANIMABLE_TYPES macro

The size of the commit is justified by the API change in the
AnimatedVariable class. No more vec(), fl() or col() method but a unified
value() method.

* animation: Remove visitor pattern

* animation: Fix coding style

* animation: Fix coding style
2024-03-02 00:35:17 +00:00
Anton Samokhvalov bcec082a1c
build: fix libc++/clang build (#4886) 2024-02-29 15:01:56 +00:00
Vaxry 2e111c8cf9 xdg: rewrite entire popup implementation 2024-02-29 14:26:02 +00:00
Vaxry b39dcfa497 refactor: move a few things to desktop/ 2024-02-29 13:03:38 +00:00
Vaxry b1c0f1cc01
subsurface: Rewrite the subsurface tree (#4877) 2024-02-29 00:03:28 +00:00
Vaxry 097f561e41 surfacetree: Revert "subsurfaceTree: assign surfaces to a CWLSurface"
This reverts commit 51b1b17fcb.

Crash issues, fixes #4874
2024-02-28 19:42:04 +00:00
Vaxry 51b1b17fcb subsurfaceTree: assign surfaces to a CWLSurface
fixes #4872
2024-02-28 17:53:17 +00:00
Vaxry 29cdd7de1f layers: minor fixes for new animations 2024-02-28 15:59:45 +00:00
Vaxry 4bc669f933 layers: add fully featured animations
Adds configs and layerrules to handle them

alas fixes #981

I have cooked
2024-02-28 15:00:40 +00:00
Tobias Zimmermann 489ac40abd
config: Add option to resolve keybinds by sym instead of code (#4851)
This commit adds the new configuration option 'resolve_binds_by_sym'
which can be set globally or per-device. It is off by default, which
preserves the current behavior.

This setting only affects the behavior of keybinds that are defined via
key symbols, not those defined via keycode. Binds defined by symbols
currently activate if the keycode pressed would generate the specified
symbol on the first layout specified in the input section.
If enabled, keys pressed on the relevant device will instead match
keybinds by the symbols they produce with their current layout.

Closes #1881.
2024-02-27 23:21:22 +00:00
Vaxry e3373669e5 wayland: implement keyboard_shortcuts_inhibit_v1
fixes #4568
2024-02-27 23:15:24 +00:00
Vaxry f26d7aa58d config: add defaultName for workspace rules
alas, fixes #665
2024-02-27 22:44:42 +00:00
Vaxry e2c286548d avar: return curve value of 1 when not animated
fixes #4862
2024-02-27 22:34:07 +00:00
Philip Damianik 60f81b8a23
input: Map touch devices and tablets bound to an output (#3544)
* Map bound touch devices and tablets to an output

* Add "[[Auto]]" default option for auto detecting outputs for touch inputs

* Bind new monitors to configured touch and tablet devices

* Use Monitor::matchesStaticSelector in CConfigManager::getMonitorRuleFor

* Use Monitor::matchesStaticSelector in CCompositor::getMonitorFromString
2024-02-27 22:11:59 +00:00
github-usr-name 81fe2ae7f1
surface: ensure global pointers valid before using in destructor (#4844)
This fixes an observed SigSegV resulting from the cursor surface using
`g_pInputManager` when invoked from the `CInputManager` destructor

Co-authored-by: github-user-name <spam-here@github.com>
2024-02-26 09:52:12 +00:00
Vaxry 8c3613632a renderer: nuke lastFrameDamage and rework finalDamage
this fucking SUCKED
2024-02-23 01:02:32 +00:00
Vaxry 7ea37c9dc9 surface: fix damage calcs with a viewport src 2024-02-20 15:21:30 +00:00
Vaxry fe9c8d8745 format: fix formatting 2024-02-19 17:20:39 +00:00
Vaxry 1763566308 surface: minor fixes for last logicalDamage calc fix 2024-02-19 11:34:55 +00:00
Vaxry e4790e3f8e surface: fix invalid damage tracking in damageSurface
ref #4744
2024-02-19 11:24:54 +00:00
Vaxry 13f6f0b923
Migrate the config to hyprlang (#4656)
* Migrate to hyprlang

* pop up errors

* fix swapped args

* Meson & Nix: build with hyprlang

* CI: add hyprlang to setup action

* add infra for plugin stuff

* fix hyprctl getoption

* fix hyprctl getoption with json

* format

* fix post parse logic

* fix autogen config

* oops missed exec-once

* fmt

* fix ws rules

* require 0.3.0 for hyprlang

* nix: flaek

* minor type fixes

* fix cfg usages in swipe

* use cvarlist for ws rules

* fix throw in addPluginConfigVar

* Nix: update hyprlang

* minor fixes

* fix disableLogs

* mention hyprlang docs

* bump hyprlang dep in cmake

* Meson: bump min hyprlang version

Nix: update hyprlang

* minor fix

* Nix: update meson patch

---------

Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
2024-02-18 15:00:34 +00:00
Abílio Costa e3e7e1fdda
monitor: don't damage twice (#4727)
When scaled, the ring is already fully damaged, no need to add the region
damage.

Also moved a variable that was being declared way to far for where it is
actually used.

Co-authored-by: Abilio Costa <abilio.costa@criticaltechworks.com>
2024-02-17 02:09:12 +00:00
Jacob Birkett a8dae8f5e1
socket2: `monitoraddedv2` IPC event for monitor description and id (#4646)
* add monitor szShortDescription without DRM node name

* change hyprctl to use szShortDescription

* add monitoraddedv2 event

* add monitor ID as first param of monitoraddedv2
2024-02-15 14:22:20 +00:00
Vaxry 305b1419c8 renderer: accept custom state requests for fake outputs 2024-02-14 22:05:41 +00:00
Sefa Eyeoglu 334a0f03ee
keybinds: Fix focus not moving along when moving workspace (#4660)
---------

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2024-02-09 23:47:00 +00:00
Vaxry 181f651de2 vector: avoid min0 clamps without a max being invalid 2024-02-05 22:37:34 +00:00
MightyPlaza cbadf3e3f3
input: focus window on mouse down on decoration (#4514)
Also unifies vectorToWindow funcs
2024-02-04 15:40:20 +00:00
Vaxry 504ebe1b37 box: add missing include 2024-02-03 01:31:52 +00:00
Vaxry 341e04a36c dwindle: avoid sending negative sizes to wlr
fixes #4591
2024-02-02 15:04:04 +00:00
Abílio Costa 15316aaa31
subsurfaceTree: Fix nullptr crash when disconnecting a monitor (#4577)
I was able to reproduce this frequently by having a kitty terminal on an
monitor running the following command and then unplugging that monitor:

`while true; do echo "" && sleep 0.02; done`
2024-02-01 03:09:31 +00:00
Vaxry bfcc2adbda monitor: wrap usage of wlr_output_state
for better control and convenience in usage.

fixes #4546
2024-01-28 01:57:13 +00:00
Vaxry 9002657bcc monitor: don't call output_state_finish on buffer-less state clears
ref #4546
2024-01-28 00:41:54 +00:00
Vaxry bc7e488a4c monitor: clear output state after usage
fixes massive lag
2024-01-27 19:11:14 +00:00
Vaxry 7b3d039388 deps: update wlroots
drops requirement for WLR_DRM_NO_ATOMIC provided kernel >= 6.8
2024-01-27 13:58:28 +00:00
rszyma 12d79d6342
dwindle: fix windows being created at incorrect position when cursor is over reserved area (#4520)
* fix: smart_split not working correctly when creating a window with cursor over reserved area

* use getClosestNodeOnWorkspace instead of getFirstNodeOnWorkspace when hovering over reserved area

* optimize `getClosestNodeOnWorkspace`

* remove unused methods
2024-01-26 22:30:36 +00:00
Vaxry 791e1b96b3 internal: minor header cleanup 2024-01-23 01:32:34 +00:00
Vaxry 5eeec8860e core: improve cleanup logic 2024-01-19 16:20:30 +01:00
Vaxry c4365f20ed damage: use buffer_damage instead of effective_damage 2024-01-17 16:01:20 +01:00
virchau13 3c964a9fdc
keybinds: Add dispatcher for xmonad/qtile-style workspace switching (#4439)
* feat: implement xmonad/qtile-style workspace switching

Implements the focusWorkspaceOnCurrentMonitor dispatcher and function,
which implements XMonad/Qtile-style workspace switching.

When called, focusWorkspaceOnCurrentMonitor will:
1. Send the requested workspace to the current monitor,
2. If the workspace was previously active on a different monitor,
   replace it with the workspace that was previously active on the
   current monitor,
3. Focus the workspace on the current monitor.

* fix: address PR comments
2024-01-15 16:30:46 +01:00
Vaxry 6b92144f15 surface: avoid spam of window surfaces with scale and transform events
fixes #4408
2024-01-11 14:07:28 +01:00
Vaxry 71166ef40b subsurfaceTree: update surface tree protocol feedback on map 2024-01-09 18:14:08 +01:00