Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

Windows spawn somewhere in the corner

Open DADA30000 opened this issue 1 year ago • 18 comments

Hyprland Version

System/Version info
Hyprland, built from branch  at commit f8857e6072bd85b95393499688872aaf7f088b5b  ().
Date: 2024-05-18
Tag: , commits: 

flags: (if any)


System Information:
System name: Linux
Node name: nixos
Release: 6.9.1
Version: #1-NixOS SMP PREEMPT_DYNAMIC Fri May 17 10:18:09 UTC 2024


GPU information: 
	Flags: bus master, VGA palette snoop, 66MHz, medium devsel, latency 64, NUMA node 0, IOMMU group 11
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU117 [GeForce GTX 1650] [10de:1f82] (rev a1) (prog-if 00 [VGA controller])


os-release: ANSI_COLOR="1;34"
BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues"
BUILD_ID="24.05.20240517.4a6b83b"
DOCUMENTATION_URL="https://nixos.org/learn.html"
HOME_URL="https://nixos.org/"
ID=nixos
IMAGE_ID=""
IMAGE_VERSION=""
LOGO="nix-snowflake"
NAME=NixOS
PRETTY_NAME="NixOS 24.05 (Uakari)"
SUPPORT_URL="https://nixos.org/community.html"
VERSION="24.05 (Uakari)"
VERSION_CODENAME=uakari
VERSION_ID="24.05"


plugins:
  hyprexpo by Vaxry ver 1.0

Bug or Regression?

Bug

Description

https://github.com/hyprwm/Hyprland/assets/73874445/eda0c1b4-1b97-451d-b9da-d6bf8ba0b465

How to reproduce

Use latest hyprland from git

Crash reports, logs, images, videos

No response

DADA30000 avatar May 19 '24 16:05 DADA30000

Please attach config. Cannot repro.

The-Briel-Deal avatar May 19 '24 21:05 The-Briel-Deal

Can you also give steps to reproduce this issue? And can you explain what the issue is? It looks like the auth pop up is popping up in the top right. Is that the the problem?

The-Briel-Deal avatar May 20 '24 08:05 The-Briel-Deal

Before some update, all windows were opening in the center (launcher and auth window), now they are just spawning in random corners, but not in the center, when I will be home I will try to find generation where that problem doesn't occur

DADA30000 avatar May 20 '24 09:05 DADA30000

And steps to reproduce

  1. Install hyprland using flake on NixOS
  2. Open floating window

DADA30000 avatar May 20 '24 09:05 DADA30000

And steps to reproduce

1. Install hyprland using flake on NixOS

2. Open floating window

same energy as "install linux, why no work" :rofl:

I suspect it's this

Agent00Ming avatar May 20 '24 09:05 Agent00Ming

I have the same issue. Any floating window no longer spawns in center of screen but off to upper left corner. I changed nothing in my config. What I've been doing for the time being is making window rules for all floating windows and popups. Kind of tedious.

Using the latest git no plugins.

Plyply99 avatar May 20 '24 13:05 Plyply99

https://github.com/hyprwm/Hyprland/assets/103620143/33feeb64-ce07-4465-9316-685a6a12f83d

Plyply99 avatar May 20 '24 13:05 Plyply99

Video_2024-05-20_09-44-40.mp4

This doesn't look like no config lol. Can you post the config. I am trying this right now and I am not getting this issue. I'll try it with OP's config a later today and update this.

The-Briel-Deal avatar May 21 '24 11:05 The-Briel-Deal

hyprland.zip

Here you are friend.

Plyply99 avatar May 21 '24 11:05 Plyply99

I wonder if this could be because of a mesa bug as mentioned here:

https://github.com/russelltg/wl-screenrec/issues/47

And here:

https://gitlab.freedesktop.org/mesa/mesa/-/issues/10658

Plyply99 avatar May 24 '24 06:05 Plyply99

This bug also causes the context menu of nm-applet from tray to appear at the bottom of the screen, making it unusable Screenshot_20240524_131551

SnipeXandrej avatar May 24 '24 11:05 SnipeXandrej

nevermind, doesn't happen anymore in a normal non-nested session (although it did some days ago, weird...)

but the windows spawning in the top-left / bottom-right / bottom-center / whatever corners still happens

SnipeXandrej avatar May 24 '24 11:05 SnipeXandrej

it seems the center window rule still works, heres a video showing a popup w/ the center window rule and without

Center: https://github.com/hyprwm/Hyprland/assets/45904911/6dcd68a5-54fb-4233-a7a2-97fad56e9bd4 Without center: https://github.com/hyprwm/Hyprland/assets/45904911/0a7ba551-eb65-474b-bf2e-c0e6f812b86e

hyprctl systeminfo (this issue also happened on my nvidia machine fyi)

Hyprland, built from branch  at commit 7ad9116de8d0b7dac27eaf080bd92998a8fb40e5  ().
Date: 2024-05-22
Tag: , commits: 

flags: (if any)


System Information:
System name: Linux
Node name: goopnet-interface
Release: 6.9.0
Version: #1-NixOS SMP PREEMPT_DYNAMIC Tue Jan  1 00:00:00 UTC 1980


GPU information: 
00:02.0 VGA compatible controller [0300]: Intel Corporation Iris Plus Graphics G4 (Ice Lake) [8086:8a5c] (rev 07) (prog-if 00 [VGA controller])
74:00.1 Non-VGA unclassified device [0000]: Apple Inc. T2 Bridge Controller [106b:1801] (rev 01)
74:00.2 Non-VGA unclassified device [0000]: Apple Inc. T2 Secure Enclave Processor [106b:1802] (rev 01)


os-release: ANSI_COLOR="1;34"
BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues"
BUILD_ID="24.05.20240521.5710852"
DOCUMENTATION_URL="https://nixos.org/learn.html"
HOME_URL="https://nixos.org/"
ID=nixos
IMAGE_ID=""
IMAGE_VERSION=""
LOGO="nix-snowflake"
NAME=NixOS
PRETTY_NAME="NixOS 24.05 (Uakari)"
SUPPORT_URL="https://nixos.org/community.html"
VERSION="24.05 (Uakari)"
VERSION_CODENAME=uakari
VERSION_ID="24.05"


plugins:

reidlabwastaken avatar May 24 '24 14:05 reidlabwastaken

it seems the center window rule still works, heres a video showing a popup w/ the center window rule and without

Center: https://github.com/hyprwm/Hyprland/assets/45904911/6dcd68a5-54fb-4233-a7a2-97fad56e9bd4 Without center: https://github.com/hyprwm/Hyprland/assets/45904911/0a7ba551-eb65-474b-bf2e-c0e6f812b86e

hyprctl systeminfo (this issue also happened on my nvidia machine fyi)

Hyprland, built from branch  at commit 7ad9116de8d0b7dac27eaf080bd92998a8fb40e5  ().
Date: 2024-05-22
Tag: , commits: 

flags: (if any)


System Information:
System name: Linux
Node name: goopnet-interface
Release: 6.9.0
Version: #1-NixOS SMP PREEMPT_DYNAMIC Tue Jan  1 00:00:00 UTC 1980


GPU information: 
00:02.0 VGA compatible controller [0300]: Intel Corporation Iris Plus Graphics G4 (Ice Lake) [8086:8a5c] (rev 07) (prog-if 00 [VGA controller])
74:00.1 Non-VGA unclassified device [0000]: Apple Inc. T2 Bridge Controller [106b:1801] (rev 01)
74:00.2 Non-VGA unclassified device [0000]: Apple Inc. T2 Secure Enclave Processor [106b:1802] (rev 01)


os-release: ANSI_COLOR="1;34"
BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues"
BUILD_ID="24.05.20240521.5710852"
DOCUMENTATION_URL="https://nixos.org/learn.html"
HOME_URL="https://nixos.org/"
ID=nixos
IMAGE_ID=""
IMAGE_VERSION=""
LOGO="nix-snowflake"
NAME=NixOS
PRETTY_NAME="NixOS 24.05 (Uakari)"
SUPPORT_URL="https://nixos.org/community.html"
VERSION="24.05 (Uakari)"
VERSION_CODENAME=uakari
VERSION_ID="24.05"


plugins:

The mesa bug I posted affects AMD. Looks like you're on Intel?

Plyply99 avatar May 24 '24 14:05 Plyply99

The mesa bug I posted affects AMD. Looks like you're on Intel?

yeah, iris plus g4 (integrated graphics for the i3-1000ng4) i do not have any AMD gpus on this system

reidlabwastaken avatar May 24 '24 14:05 reidlabwastaken

Same issue after switching to git version (Because the waybar module idle_inhibitor did not work). Seems like it happens only with gnome-polkit window in my case. For example, in the video I opened the zenity window, which appeared in the center as needed. Also, the telegram context menu slides to the center (or above) of the screen when it was invoked at the bottom of the screen (in which case it is expected to be drawn just above the selected message, but not in another part of the screen). I admit that this may be a telegram problem

https://github.com/hyprwm/Hyprland/assets/84767665/4e1b92db-fad1-49d0-8c4e-3364a504b06c

shvedes avatar May 26 '24 16:05 shvedes

I noticed that this behavior happened after this commit 4cdddcfe466cb21db81af0ac39e51cc15f574da9, so it was the last good commit It happened somewhere here: 121d3a72137d4780602cf245704615f63357ea22, 0cfdde3d1acbfbf698af17f6986fbc4d644214da, fc72df8e58bc127442a245f2f29a3246acf77cce And on this commit 7eeee2c94e882a5df1914234df0571b221f9aa35 windows were not spawning in the center anymore Maybe this helps

lionur avatar May 26 '24 21:05 lionur

they always seem to spawn at X = width / 2 and Y = height / 2, so there is likely a typo somewhere.

MightyPlaza avatar Jun 02 '24 20:06 MightyPlaza

patch.txt like this?

vaxerski avatar Jun 02 '24 20:06 vaxerski

close they now spawn at the center + window_size / 2 instead of center - window_size / 2 edit: lol let me change the patch and test

MightyPlaza avatar Jun 02 '24 20:06 MightyPlaza

diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp
index 108f9039..123f27ac 100644
--- a/src/layout/IHyprLayout.cpp
+++ b/src/layout/IHyprLayout.cpp
@@ -147,7 +147,7 @@ void IHyprLayout::onWindowCreatedFloating(PHLWINDOW pWindow) {
                 pWindow->m_vRealPosition = pWindow->m_pXDGSurface->toplevel->parent->window->m_vRealPosition.goal() +
                     pWindow->m_pXDGSurface->toplevel->parent->window->m_vRealSize.goal() / 2.F - desiredGeometry.size() / 2.F;
             else
-                pWindow->m_vRealPosition = PMONITOR->vecPosition + desiredGeometry.size() / 2.F;
+                pWindow->m_vRealPosition = PMONITOR->vecPosition + PMONITOR->vecSize / 2.F - desiredGeometry.size() / 2.F;
         } else {
             // if it is, we respect where it wants to put itself, but apply monitor offset if outside
             // most of these are popups

fixes it

MightyPlaza avatar Jun 02 '24 20:06 MightyPlaza

isnt that what I've done? maybe its too late and I am idiot

vaxerski avatar Jun 02 '24 21:06 vaxerski

is this fixed now then?

vaxerski avatar Jun 02 '24 21:06 vaxerski

you might have dropped two commits during force push but that did fix this issue :P 6868a39f1145dcb11c1d721e765077f21128e80c and 1cc35cfd817ed5dc87cb3e50e2bd46b87cf17c33

Agent00Ming avatar Jun 02 '24 21:06 Agent00Ming

sometimes I feel like I should revoke the perms to force push to main from myself, muscle memory sometimes does -f...

vaxerski avatar Jun 03 '24 14:06 vaxerski

done, enjoy

vaxerski avatar Jun 03 '24 16:06 vaxerski