Turning off and on monitor (using on monitor controller) makes floating all windows #472

Closed
opened 2023-09-01 10:43:45 +02:00 by mortezadadgar · 19 comments
mortezadadgar commented 2023-09-01 10:43:45 +02:00 (Migrated from github.com)

Info

dwl version: dwl v0.4-45-g3c9742a-dirty
wlroots version: wlroots-0.16.2-r1

Description

I don't think there is anything left to add to this bug report I tried to get stacktrace of dwl using ssh but it doesn't seem to be related
Edit: doing the same using wlr-randr doesn't freezes the output

## Info dwl version: dwl v0.4-45-g3c9742a-dirty wlroots version: wlroots-0.16.2-r1 ## Description I don't think there is anything left to add to this bug report I tried to get stacktrace of dwl using ssh but it doesn't seem to be related Edit: doing the same using wlr-randr doesn't freezes the output
mortezadadgar commented 2023-09-03 08:42:18 +02:00 (Migrated from github.com)

I was able to catch a stacktrace
gdb.txt

I was able to catch a stacktrace [gdb.txt](https://github.com/djpohly/dwl/files/12505313/gdb.txt)
sevz17 commented 2023-09-03 19:46:38 +02:00 (Migrated from github.com)

Can you check #474?

Can you check #474?
mortezadadgar commented 2023-09-03 20:18:35 +02:00 (Migrated from github.com)

@sevz17 it doesn't freeze or crash anymore though there's another bug that turns all tiling windows into floating after turning on the monitor

@sevz17 it doesn't freeze or crash anymore though there's another bug that turns all tiling windows into floating after turning on the monitor
sevz17 commented 2023-09-03 20:21:04 +02:00 (Migrated from github.com)

You are using just one monitor, right?

You are using just one monitor, right?
mortezadadgar commented 2023-09-03 20:21:22 +02:00 (Migrated from github.com)

yes

yes
sevz17 commented 2023-09-03 20:25:11 +02:00 (Migrated from github.com)

Can you check again? but with the two lines I added below wlr_scene_node_reparent

Can you check again? but with the two lines I added below `wlr_scene_node_reparent`
mortezadadgar commented 2023-09-03 20:34:38 +02:00 (Migrated from github.com)

moving two lines changes you made below wlr_scene_node_reparent made no difference

moving two lines changes you made below `wlr_scene_node_reparent` made no difference
sevz17 commented 2023-09-03 20:40:36 +02:00 (Migrated from github.com)

I see, I'm a bit busy rn.
I'll check in more detail asap.

I see, I'm a bit busy rn. I'll check in more detail asap.
sevz17 commented 2023-09-04 05:02:22 +02:00 (Migrated from github.com)

@mortezadadgar, can you try #474 again?

@mortezadadgar, can you try #474 again?
mortezadadgar commented 2023-09-04 09:05:56 +02:00 (Migrated from github.com)

same

same
sevz17 commented 2023-09-07 06:31:09 +02:00 (Migrated from github.com)

I merged #474, as you said it does not fix the problem about the floating windows (but it's better than a segfault). This remains open until I figure out how to solve the problem.

I merged #474, as you said it does not fix the problem about the floating windows (but it's better than a segfault). This remains open until I figure out how to solve the problem.
mortezadadgar commented 2023-09-11 10:30:40 +02:00 (Migrated from github.com)

more observations on toggle monitor:

  • kills all windows from other tags and move the last tag windows to tag 1 and make it floating
  • stops lockscreen client from receiving any keyboard events (tested with waylock and swaylock)
more observations on toggle monitor: - kills all windows from other tags and move the last tag windows to tag 1 and make it floating - stops lockscreen client from receiving any keyboard events (tested with waylock and swaylock)

now I'm getting a segmentation fault on new wlroots version
dwl version: dwl v0.5-60-ga5fcd31
wlroots version: 0.17.1-1

now I'm getting a segmentation fault on new wlroots version dwl version: dwl v0.5-60-ga5fcd31 wlroots version: 0.17.1-1
1.3 KiB

@sevz sorry forgot to tag your new account

@sevz sorry forgot to tag your new account

@mortezadadgar, can you apply this diff and tell me if it still crashes?

diff --git a/dwl.c b/dwl.c
index 962748b..572061d 100644
--- a/dwl.c
+++ b/dwl.c
@@ -733,7 +733,7 @@ commitnotify(struct wl_listener *listener, void *data)
 {
 	Client *c = wl_container_of(listener, c, commit);
 
-	if (client_surface(c)->mapped)
+	if (client_surface(c)->mapped && c->mon)
 		resize(c, c->geom, (c->isfloating && !c->isfullscreen));
 
 	/* mark a pending resize as completed */
@mortezadadgar, can you apply this diff and tell me if it still crashes? ```diff diff --git a/dwl.c b/dwl.c index 962748b..572061d 100644 --- a/dwl.c +++ b/dwl.c @@ -733,7 +733,7 @@ commitnotify(struct wl_listener *listener, void *data) { Client *c = wl_container_of(listener, c, commit); - if (client_surface(c)->mapped) + if (client_surface(c)->mapped && c->mon) resize(c, c->geom, (c->isfloating && !c->isfullscreen)); /* mark a pending resize as completed */ ```

@sevz Yes that solves the segmentation fault but still turning on/off monitor doesn't preserve last windows arrangements as explained above.

@sevz Yes that solves the segmentation fault but still turning on/off monitor doesn't preserve last windows arrangements as explained above.
Owner

To explain the cause of this issue: selmon gets set to NULL on last monitor disconnect. That makes the monitors of the clients NULL. Selmon is not set to first connected monitor, it stays NULL, and the clients monitor are never set to the newly connected monitor (but stay NULL), as would be the case if there were two monitors, and one got disconnected. The user would have to manually move the clients to the monitor with some function to make them not "floating" - they are not actually "floating", it just seems they are since NULL monitor doesn't exist, have any layout etc.

This part of this issue is fixed by #621 that makes sure selmon is set to connected monitor and clients without monitor moved there.

To explain the cause of this issue: selmon gets set to NULL on last monitor disconnect. That makes the monitors of the clients NULL. Selmon is not set to first connected monitor, it stays NULL, and the clients monitor are never set to the newly connected monitor (but stay NULL), as would be the case if there were two monitors, and one got disconnected. The user would have to manually move the clients to the monitor with some function to make them not "floating" - they are not actually "floating", it just seems they are since NULL monitor doesn't exist, have any layout etc. This part of this issue is fixed by #621 that makes sure selmon is set to connected monitor and clients without monitor moved there.
Owner

kills all windows from other tags and move the last tag windows to tag 1 and make it floating

I don't think the clients from other tags were actually killed, they are just not visible, and impossible to recover without change of dwl code.

> kills all windows from other tags and move the last tag windows to tag 1 and make it floating I don't think the clients from other tags were actually killed, they are just not visible, and impossible to recover without change of dwl code.

Fixed by #621.

Fixed by #621.
sevz closed this issue 2024-06-22 07:33:00 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dwl/dwl#472
No description provided.