! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Only transient window gets raised when switching to an app
Status:
RESOLVED: FIXED

Comments

Description Adam Purkrt 2018-01-15 06:02:44 CET
When an app has a transient window, clicking on the app's button on panel brings forward only the transient.

steps to reproduce:

1) launch thunar, maximize it
2) launch mousepad, open its preferences window (edit/preferences)
3) switch to thunar
4) try to switch back to mousepad using the window's button

Only the preferences (i.e. the transient window) will be raised, the mousepad window itself will still be buried under the thunar window.

Using latest version from git.
Comment 1 Adam Purkrt 2018-01-18 23:36:41 CET
Looks like xfwm4 is the culprit. Old xfwm4 4.12 running with new tasklist (window buttons) works fine (raises transient -and- the corresponding transient parent window), whereas current xfwm4 from git does not raise the transient parent window.
Comment 2 Olivier Fourdan editbugs 2018-01-19 19:35:39 CET
Works fine here, I cannot reproduce that bug.
Comment 3 Olivier Fourdan editbugs 2018-01-19 19:40:02 CET
Also worth noting that raising a transient does not imply raising ita parent, that's on purpose. But raising the parent will raise all the transients.

So if the window button raises only the transient window, it's normal that only the transient window ends up above, alone.
Comment 4 Adam Purkrt 2018-01-20 14:35:49 CET
Of course, raising only a transient when clicking on transient itself is ok.
But the window buttons works (should work) like "switch to" (alt-tab), which does raise both transient and its sibling.
Comment 5 Olivier Fourdan editbugs 2018-01-20 15:16:09 CET
Using the debug logs, you can tell which window id is sent through the "_NET_ACTIVE_WINDOW" client message, and determine if this is either a libwnck bug or xfwm4.

https://standards.freedesktop.org/wm-spec/wm-spec-latest.html#idm140200472702304
Comment 6 Adam Purkrt 2018-01-20 19:41:58 CET
Created attachment 7552 
bug-only-transient-gets-raised.mkv

video demonstrating the bug - only the transient gets raised
Comment 7 Adam Purkrt 2018-01-20 19:46:55 CET
(In reply to Olivier Fourdan from comment #5)
> Using the debug logs, you can tell which window id is sent through the
> "_NET_ACTIVE_WINDOW" client message, and determine if this is either a
> libwnck bug or xfwm4.
> 
> https://standards.freedesktop.org/wm-spec/wm-spec-latest.
> html#idm140200472702304

The logs are really "heavy", I am unable to sift through all the data at the moment...
Anyway, I tried runnning xfwm4 from git with the rest of xfce components from 4.12 (compiled just xfwm on an arch machine), and the bug persists in this case. On the other hand, as I have written, if I use xfwm4 4.12.4 with the rest of the components new (git versions), the problem goes away. Really as if xfwm4 was causing it.
Comment 8 Adam Purkrt 2018-01-20 23:28:17 CET
Found it. The problem lies in xfwm4 in clientActivate function which has changed from 4.12.4.

In 4.12.4 the important part was (lines 2597-2598)
        clientRaise (sibling, None);
        clientShow (sibling, TRUE);

In current git, the part reads (linex 2609-2614)
        clientShow (sibling, TRUE);
        if (!screen_info->params->click_to_focus)
        {
            clientRaise (sibling, None);
            clientSetLastRaise (c);
        }


If I add clientRaise (sibling, None); before the clientShow (without the if) switching immediately works fine.
Comment 9 Adam Purkrt 2018-01-20 23:41:46 CET
introduced by commit 3877bf45d39928b2ec485945af1fba7a16645c7d
Comment 10 Olivier Fourdan editbugs 2018-01-21 15:32:26 CET
And yet, even without click to focus here, it works...

Can you provide the output of “xfconf-query -vl -c xfwm4”?
Comment 11 Adam Purkrt 2018-01-21 15:51:56 CET
Well, no surprise it works -without- click to focus. Without click to focus it works for me too. There is !screen_info->params->click_to_focus (there is negation). With click to focus (default setting, and my preferred setting) it does not work - and it should, in my opinion.

The critical part is to raise the sibling - "clientRaise (sibling, None)". The program does not get there when click_to_focus==TRUE.

The problem is there even with default config; will upload the xfconf-query momentarily.
Comment 12 Adam Purkrt 2018-01-21 15:53:14 CET
Created attachment 7553 
xfconf-query -vl -c xfwm4
Comment 13 Olivier Fourdan editbugs 2018-01-21 15:54:18 CET
Sorry I didn't make myself clear, it works in all cases here... Click to focus is also my default, so there must be something else coming into play...
Comment 14 Adam Purkrt 2018-01-21 16:07:21 CET
Is there some other place where the sibling is raised? Strange you cannot reproduce. I encounter this with geany. Open find window to navigate around code, switch to maximized firefox to read something on web, switch to back and bummer - only the "find" window (transient) is brought to forward.
Comment 15 Olivier Fourdan editbugs 2018-01-21 16:12:46 CET
Oh, I think I know...
Comment 16 Git Bot editbugs 2018-01-21 17:05:22 CET
Olivier Fourdan referenced this bugreport in commit a33fc7afbcfdddf20f29e60207c3b59ade9396d2

stacking: Raise ancestor on activate if different from window

https://git.xfce.org/xfce/xfwm4/commit?id=a33fc7afbcfdddf20f29e60207c3b59ade9396d2
Comment 17 Adam Purkrt 2018-01-21 17:22:30 CET
Perfect, working now. Thank you very much! Closing as fixed.
Comment 18 Git Bot editbugs 2018-01-21 17:39:38 CET
Olivier Fourdan referenced this bugreport in commit 15a64b0f66856af40b324d9869fb2002abc40c42

stacking: Raise on activate w/out click-to-focus

https://git.xfce.org/xfce/xfwm4/commit?id=15a64b0f66856af40b324d9869fb2002abc40c42

Bug #14164

Reported by:
Adam Purkrt
Reported on: 2018-01-15
Last modified on: 2018-01-21

People

Assignee:
Nick Schermer
CC List:
1 user

Version

Version:
unspecified

Attachments

bug-only-transient-gets-raised.mkv (316.30 KB, video/x-matroska)
2018-01-20 19:41 CET , Adam Purkrt
no flags
xfconf-query -vl -c xfwm4 (3.46 KB, text/plain)
2018-01-21 15:53 CET , Adam Purkrt
no flags

Additional information