Skip to content

dekstop/window: read static rules before guessing initial size if possible#12783

Merged
vaxerski merged 7 commits into
hyprwm:mainfrom
vaxerski:floatsizefix
Jan 1, 2026
Merged

dekstop/window: read static rules before guessing initial size if possible#12783
vaxerski merged 7 commits into
hyprwm:mainfrom
vaxerski:floatsizefix

Conversation

@vaxerski

Copy link
Copy Markdown
Member

Ref #12753

@C0Florent

Copy link
Copy Markdown
Contributor

did you fix something else in your force push?
I started to build at d551986, i'm just curious if i should restart with your latest commit or if it's the same thing

@vaxerski

Copy link
Copy Markdown
Member Author

no I just rebased

@fxzzi

fxzzi commented Dec 31, 2025

Copy link
Copy Markdown
Contributor
image

rename dialog in thunar now opens the correct size

@C0Florent

Copy link
Copy Markdown
Contributor

I must be doing something wrong, as soon as I press any of my binds to open an app (even those which i don't open floating) hyprland crashes (segv) and I get sent into safe mode.
in safe mode I can use binds to open windows, no problem, I can load my config and everything is fine but if then i press a bind to open anything it crashes again
might be related to something else on main, i was using 0.53 before

from the safe mode environment it seems like when i have a bind to exec, [float] $terminal, it doesn't open floating. could be something the default config, or a bug idk. If i force it to open floating with a windowrule however it does open with the right size, so I guess the fix is working (?)

@vaxerski

Copy link
Copy Markdown
Member Author

mamma mia you are correct

@vaxerski

Copy link
Copy Markdown
Member Author

couldnt repro the crash tho

@C0Florent

Copy link
Copy Markdown
Contributor

I'll try to rebuild with this, just as additional info, it must be my config running some specific codepaths because i was crashing when any windows were getting opened, no matter if it was by exec-once or by running something from a terminal (the terminal being opened in safe mode then loading my config before trying to open something else)

@vaxerski

Copy link
Copy Markdown
Member Author

gdb stacktrace pls

@C0Florent

Copy link
Copy Markdown
Contributor

gdb stacktrace pls

I'm happy to see there's a hyprland-debug nix package, I should be able to get a trace quicker than I anticipated thanks to the awesome wiki

@C0Florent

Copy link
Copy Markdown
Contributor

ah, actually nix build fails on this PR so that doesn't help immediately

@vaxerski

Copy link
Copy Markdown
Member Author

I can see the tester in CI is dying too but I cant repro here lole

@C0Florent

Copy link
Copy Markdown
Contributor

i'm getting this, seems to be simple to fix? i know basically nothing about cmake though

CMake Error at hyprtester/CMakeLists.txt:84 (add_executable):
  Cannot find source file:

    clients/pointer-warp.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm
  .ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90
  .f95 .f03 .hip .ispc
Call Stack (most recent call first):
  hyprtester/CMakeLists.txt:101 (clientNew)


CMake Error at hyprtester/CMakeLists.txt:84 (add_executable):
  Cannot find source file:

    clients/pointer-scroll.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm
  .ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90
  .f95 .f03 .hip .ispc
Call Stack (most recent call first):
  hyprtester/CMakeLists.txt:102 (clientNew)


CMake Error at hyprtester/CMakeLists.txt:84 (add_executable):
  Cannot find source file:

    clients/child-window.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm
  .ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90
  .f95 .f03 .hip .ispc
Call Stack (most recent call first):
  hyprtester/CMakeLists.txt:103 (clientNew)


CMake Error at hyprtester/CMakeLists.txt:84 (add_executable):
  Cannot find source file:

    clients/shortcut-inhibitor.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm
  .ccm .cxxm .c++m .h .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90
  .f95 .f03 .hip .ispc
Call Stack (most recent call first):
  hyprtester/CMakeLists.txt:104 (clientNew)


CMake Error at CMakeLists.txt:636 (add_executable):
  No SOURCES given to target: hyprland_gtests
  

CMake Error at hyprtester/CMakeLists.txt:16 (add_executable):
  No SOURCES given to target: hyprtester


CMake Error at hyprtester/CMakeLists.txt:84 (add_executable):
  No SOURCES given to target: pointer-warp
Call Stack (most recent call first):
  hyprtester/CMakeLists.txt:101 (clientNew)


CMake Error at hyprtester/CMakeLists.txt:84 (add_executable):
  No SOURCES given to target: pointer-scroll
Call Stack (most recent call first):
  hyprtester/CMakeLists.txt:102 (clientNew)


CMake Error at hyprtester/CMakeLists.txt:84 (add_executable):
  No SOURCES given to target: child-window
Call Stack (most recent call first):
  hyprtester/CMakeLists.txt:103 (clientNew)


CMake Error at hyprtester/CMakeLists.txt:84 (add_executable):
  No SOURCES given to target: shortcut-inhibitor
Call Stack (most recent call first):
  hyprtester/CMakeLists.txt:104 (clientNew)


CMake Generate step failed.  Build files cannot be regenerated correctly.

@C0Florent

Copy link
Copy Markdown
Contributor

Anyways, this is getting too far into 2026 for tonight (2am), so i'll try to get a proper debug build tomorrow
for some reason I can't get a debug build from the hyprland flake, it seems to be failing to build hyprtester, but building non-debug works fine. ig could try a manual build from a fresh clone to only get a hyprland build in debug mode without building hyprtester if that's the only problem.

@vaxerski

Copy link
Copy Markdown
Member Author

I'm leaving for a new years get together soon too so I will check this out tomorrow if I am not too drunk from water and coca cola

@C0Florent

Copy link
Copy Markdown
Contributor

gdb stacktrace obtained
gdb.txt

@C0Florent

C0Florent commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

looks like a tasty nullptr member access

#6  0x0000555c7c627df2 in CWorkspace::matchesStaticSelector (this=0x0, selector_=...)

@C0Florent

Copy link
Copy Markdown
Contributor

This fixes it for me

diff --git a/src/desktop/rule/windowRule/WindowRule.cpp b/src/desktop/rule/windowRule/WindowRule.cpp
index d1994d2e..546680c1 100644
--- a/src/desktop/rule/windowRule/WindowRule.cpp
+++ b/src/desktop/rule/windowRule/WindowRule.cpp
@@ -93,6 +93,8 @@ bool CWindowRule::matches(PHLWINDOW w, bool allowEnvLookup) {
                     return false;
                 break;
             case RULE_PROP_ON_WORKSPACE:
+                if (!w->m_workspace)
+                    continue;
                 if (!engine->match(w->m_workspace))
                     return false;
                 break;

to my understanding it was trying to check for match:workspace props before the window was assigned a workspace, so I just skipped the check. might make more sense to try and assign a workspace before the check instead, but no idea how that would be done.

also needed this to be able to build the hyprland-debug flake output, it was trying to build hyprtester but the tests' source weren't being copied to the build directory

diff --git a/nix/overlays.nix b/nix/overlays.nix
index fdb3e652..8e947796 100644
--- a/nix/overlays.nix
+++ b/nix/overlays.nix
@@ -86,7 +86,7 @@ in {
     (final: prev: {
       aquamarine = prev.aquamarine.override {debug = true;};
       hyprutils = prev.hyprutils.override {debug = true;};
-      hyprland-debug = prev.hyprland.override {debug = true;};
+      hyprland-debug = prev.hyprland.override {debug = true; withTests = true;};
     })
   ];

once again might not be the best way to fix this, i just went with the first thing that got it to build

@vaxerski

vaxerski commented Jan 1, 2026

Copy link
Copy Markdown
Member Author

tha ks

@vaxerski

vaxerski commented Jan 1, 2026

Copy link
Copy Markdown
Member Author

@fufexan can you >> this into kitty.conf in the VM?

remember_window_size no
initial_window_width  640
initial_window_height 400

@github-actions github-actions Bot added the nix label Jan 1, 2026
@vaxerski

vaxerski commented Jan 1, 2026

Copy link
Copy Markdown
Member Author

@fxzzi @C0Florent is this fixed for you?

@fxzzi

fxzzi commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

mhm-7tv-mhm
yes

@vaxerski
vaxerski merged commit 31d3181 into hyprwm:main Jan 1, 2026
12 of 14 checks passed
C0Florent added a commit to C0Florent/config that referenced this pull request Jan 2, 2026
So that I can have this fix PR
hyprwm/Hyprland#12783
crthpl pushed a commit to crthpl/Hyprland that referenced this pull request Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants