-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spawned windows appears at the top left corner and causes flicker when moving it to the stack. #114
Comments
Cássio Ávila ***@***.***> writes:
When spawning new windows, it spawns it at the top left corner, and
quickly moves it to the stack, causing flickering. This is the only
thing stopping me from using frankenwm, because I'm quite sensitive to
flickering.
This is indeed a problem, but I'm not sure we can do much about this. We
position the window when we get notified of its spawning, and there is a
natural gap in between those two events. Before we place the window, we
cannot actually control anything about the new window, because it
doesn't exist for all we know, so we can't hide it before placing it
(afaik).
|
In dwm that doesn't happen, this is because frankenwm is in xcb and dwm uses xlib? |
I saw #34 and tested on the branch 34-fix. And the flickering is gone |
That's incredibly helpful information, thank you for taking the time to bisect this. I'll have a look at the code shortly and see if I can figure out what's happening there. |
I had the time to tinker with it and found a interesting thing. By the nature of the problem it must be inside maprequest, so I tried to see what changed between the commits. So I tried reverting parts of the function in the problematic repo, aaand i found where is the problem, in the end of maprequest. In the "working" commit it is like this: ...
if (cd != newdsk)
select_desktop(cd);
if (cd == newdsk) {
xcb_move(dis, c, -2 * M_WW, 0);
xcb_map_window(dis, c->win);
if (show)
update_current(c);
}
else
if (follow) {
change_desktop(&(Arg){.i = newdsk});
update_current(c);
}
grabbuttons(c);
xcb_ewmh_set_wm_desktop(ewmh, c->win, cd);
desktopinfo();
if (c->isfloating && AUTOCENTER)
centerfloating(c);
... and by using this part of the function in the buggy commit it fixes things. But I found a workaround: ...
int wmdsk = cd;
bool visible = True;
xcb_move(dis, c->win, -2 * M_WW, 0, &c->position_info);
xcb_map_window(dis, c->win);
if (cd != newdsk) {
visible = False;
rem_node(&c->link);
select_desktop(newdsk);
add_tail(¤t_display->clients, &c->link);
select_desktop(cd);
wmdsk = newdsk;
if (follow) {
visible = True;
change_desktop(&(Arg){.i = newdsk});
}
}
if (visible && show) {
update_current(c); // remove flicker
xcb_move(dis, c->win, c->position_info.previous_x,
c->position_info.previous_y, NULL);
c->position_info.previous_x = c->position_info.current_x;
c->position_info.previous_y = c->position_info.current_y;
update_current(c);
if (c->isfloating && AUTOCENTER)
centerfloating(c);
}
xcb_ewmh_set_wm_desktop(ewmh, c->win, wmdsk);
grabbuttons(c);
desktopinfo();
... By running |
The problem with that workaround is that it messes up the focus history by always returning to the master window (in a tiled mode). Try |
When spawning new windows, it spawns it at the top left corner, and quickly moves it to the stack, causing flickering. This is the only thing stopping me from using frankenwm, because I'm quite sensitive to flickering.
The text was updated successfully, but these errors were encountered: