18.10 → 19.04 Alt-Tab cycling no longer includes Slack window

Bug #1827302 reported by Jesse Glick
56
This bug affects 11 people
Affects Status Importance Assigned to Milestone
Xfwm4
Fix Released
Medium
xfwm4 (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Won't Fix
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned

Bug Description

I just upgraded Xubuntu from 18.10 to 19.04 and immediately noticed a regression in the behavior of the Alt-Tab keyboard shortcut to cycle windows: my Slack window is not included. It is installed via snap:

slack 3.4.0 13 stable slack✓ classic

I have several windows open besides Slack—Chromium, Emacs, Terminal, etc.—and all are visible in the notification bar at the top of my screen. But Slack is never included in the list of windows shown in the Alt-Tab dialog (all other windows are). There was no such problem prior to the upgrade.

There is a Slack icon in the Indicator plugin, from which I can open the Slack window, but that seems to be the only way.

Restarting Slack does not help.

I have tried flipping all the checkboxes in the Window Manager Tweaks » Cycling dialog (e.g., Skip windows that have "skip pager" or "skip taskbar" properties set) without success.

ProblemType: Bug
DistroRelease: Ubuntu 19.04
Package: xfwm4 4.12.5-1ubuntu1
ProcVersionSignature: Ubuntu 5.0.0-13.14-generic 5.0.6
Uname: Linux 5.0.0-13-generic x86_64
ApportVersion: 2.20.10-0ubuntu27
Architecture: amd64
CurrentDesktop: XFCE
Date: Wed May 1 21:04:41 2019
InstallationDate: Installed on 2016-10-25 (918 days ago)
InstallationMedia: Xubuntu 16.10 "Yakkety Yak" - Release amd64 (20161012.2)
ProcEnviron:
 LANGUAGE=en_US
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: xfwm4
UpgradeStatus: Upgraded to disco on 2019-05-02 (0 days ago)
modified.conffile..etc.default.apport:
 # set this to 0 to disable apport, or to 1 to enable it
 # you can temporarily override this with
 # sudo service apport start force_start=1
 enabled=0
mtime.conffile..etc.default.apport: 2017-12-12T15:20:09.416553

Revision history for this message
Jesse Glick (jesse-glick) wrote :
Revision history for this message
Revery (glajchs) wrote :

This might just be bad timing. I don't think it's your OS upgrade, I think it's the Slack release they just pushed. I'm using Xenial and this broke for me this morning when I upgraded Slack's version, however I didn't change my OS version. This might be a slack bug?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xfwm4 (Ubuntu):
status: New → Confirmed
Revision history for this message
Jean-Philippe (skateinmars) wrote :

I can confirm I have the same issue on Ubuntu 18.04, this started with Slack version 3.4.0.

Revision history for this message
Steve Chadsey (schadsey) wrote :

The issue is also present on Xubuntu 18.04.2 LTS, slack 3.4.0, xfce.

Revision history for this message
Matias N. Goldberg (dark-sylinc) wrote :

This bug started in Slack 3.4.0 and affects Xubuntu 18.04.2 LTS too.

The problem happens because xfwm4 looks for any of the following:
"_NET_WM_WINDOW_TYPE_DESKTOP",
"_NET_WM_WINDOW_TYPE_DIALOG",
"_NET_WM_WINDOW_TYPE_DOCK",
"_NET_WM_WINDOW_TYPE_MENU",
"_NET_WM_WINDOW_TYPE_NORMAL",
"_NET_WM_WINDOW_TYPE_SPLASH",
"_NET_WM_WINDOW_TYPE_TOOLBAR",
"_NET_WM_WINDOW_TYPE_UTILITY",

But Slack doesn't set them.

I compiled xfwm4 from source, debugged remotely (it is nearly impossible to halt the window manager in the host machine...) and the problem boils down to:

1. clientCycleCreateList in cycle.c calls:

    if (!clientSelectMask (c2, NULL, search_range, WINDOW_REGULAR_FOCUSABLE))
    {
        TRACE ("%s not in select mask", c2->name);
        continue;
    }

2. Inside clientSelectMask in focus.c, c2->type = 0; thus "return c2->type & mask" returns 0 regardless of the mask and thinks the window should not be alt-tabbed

3. I believe (not 100% sure) this happens because in clientWindowType in netwm.c, c->type_atom == None. I don't know whether this should be treated as a client bug or a window manager bug. I'm not an X11 expert so I don't know if it is possible to know if a window is the root one, but root windows should definitely be alt-tabbeable.

If I change the line to:

    if (!clientSelectMask (c2, NULL, search_range, WINDOW_REGULAR_FOCUSABLE) && c2->type != UNSET)

Then Slack works with alt+tab and my computer hasn't blown up yet. I don't know if it's the proper fix though, but it may be

I fixed this problem by rebuilding xfwm4 with the attached patch:

    mkdir tmp
    cd tmp
    sudo apt install devscripts build-essential fakeroot dpkg-dev
    sudo apt-get build-dep xfwm4
    apt-get source xfwm4
    cd xfwm4-4.12.5
    patch -i xfwm4_slack_fix.diff #Point it where the patch is located!!!
    debuild -b -uc -us
    sudo dpkg -i ../xfwm4_4.12.5-1ubuntu0.18.04.1_amd64.deb

Revision history for this message
Matias N. Goldberg (dark-sylinc) wrote :

Sorry my bad, the diff is reversed. Use the following commands instead:

    mkdir tmp
    cd tmp
    sudo apt install devscripts build-essential fakeroot dpkg-dev
    sudo apt-get build-dep xfwm4
    apt-get source xfwm4
    cd xfwm4-4.12.5
    patch -R -p1 -i xfwm4_slack_fix.diff # !!! Point it where the patch is located!!!
    debuild -b -uc -us
    sudo dpkg -i ../xfwm4_4.12.5-1ubuntu0.18.04.1_amd64.deb

Revision history for this message
Matias N. Goldberg (dark-sylinc) wrote :

I'm attaching .deb and .ddeb (debug symbols) files I built myself if someone's too lazy or too busy to rebuild the patched xfwm4 him/herself.

It has been working fine for me so far.

USE THEM AT YOUR OWN RISK. I AM NOT RESPONSIBLE FOR WHAT HAPPENS IF YOU TRY THEM.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Alt + Tab fix for xfwm4 and Slack" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Theo Linkspfeifer (lastonestanding) wrote :

I suggest that you forward all details and the patch to the upstream devs.

https://bugzilla.xfce.org/

Revision history for this message
Alistair Buxton (a-j-buxton) wrote :

Slack is setting NET_WM_WINDOW_TYPE = NET_WM_WINDOW_TYPE_MAIN. This value is not defined in the EWMH spec and has zero results on Google.

A temporary work around is to run `xprop -f _NET_WM_WINDOW_TYPE 32a -set _NET_WM_WINDOW_TYPE _NET_WM_WINDOW_TYPE_NORMAL` and then click on the Slack window.

Revision history for this message
Revery (glajchs) wrote :

Thank you so much Alistair! That worked for me! I actually already had a launch script for slack to do a bunch of stuff, one of the things is attaching an icon to it post-launch. I was able to modify the script to handle running the "xprop" line above automatically.

I'll post my script just in case it helps anyone, it's got comments so you can comment out sections you don't want.

It does 3 things:
1. Launches slack with dev tools available (right-click inspect)
2. Applies the slack icon to the slack window after it's launched
3. Applies the window manager "NORMAL" type to the slack window after it's launched, so alt+tab works as normal.

I launch using this script instead of the normal slack binary (I put it into ~/bin/slack and invoke it from there).

Revision history for this message
In , Alistair Buxton (a-j-buxton) wrote :

aka NET_WM_WINDOW_TYPE_POTATO

Currently Slack is not showing on the alt-tab cycle menu. This is due to Slack setting NET_WM_WINDOW_TYPE = NET_WM_WINDOW_TYPE_MAIN, which is a non-standard value. Xfwm should gracefully fallback to doing something sensible when this happens.

Changed in xfwm4:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Gitbot (gitbot) wrote :

Olivier Fourdan referenced this bugreport in commit 22fe30cdd99d111f043b3282a02f39df468c7ac2

netwm: Fix window type for broken clients

https://git.xfce.org/xfce/xfwm4/commit?id=22fe30cdd99d111f043b3282a02f39df468c7ac2

Revision history for this message
In , Alistair Buxton (a-j-buxton) wrote :

Seems to fix Slack for me.

Changed in xfwm4:
status: Confirmed → Fix Released
Revision history for this message
Jesse Glick (jesse-glick) wrote :

As original reporter, I can confirm that the xprop trick works around this problem.

I used a modification of the wrapper script from #12, after

sudo apt install wmctrl
# as of recent https://github.com/xeyownt/xseticon/pull/4
sudo snap install xseticon

and adjusting the icon path to use the snap

ICON=/snap/slack/current/usr/lib/slack/resources/app.asar.unpacked/src/static/slack.png

and using this for the xseticon binary path:

/snap/xseticon/current/bin/xseticon

Revision history for this message
Yuriy Chernichenko (nikosid) wrote :

Thanks!
It helped for me.
One thing I don't like it's after sleep time slack window goes to minimize.

Revision history for this message
Jesse Glick (jesse-glick) wrote :

I made some further adjustments to the launch script from #12 and uploaded to:

https://gist.github.com/jglick/a8613fd72bbb52a8576804e9dbd10081

After `chmod a+x`, this works for me as a script path in *Session and Startup » Application Autostart*. As in #16, this assumes Slack and xseticon are installed as snaps, and xprop is also installed.

Revision history for this message
Jesse Glick (jesse-glick) wrote :

This no longer seems to be a problem with Slack 4.0.0, recently released and available via Snap. I modified the gist to only set an icon, which it is still missing, and updated it to work with the new window manager class and icon path.

Revision history for this message
Revery (glajchs) wrote :

Beat me to it by 53 minutes Jesse! I just updated my script too, but yours is more concise. Thank you for the gist, it works great.

Revision history for this message
Sean Davis (bluesabre) wrote :

Fix included in Xfwm4 4.13.2. So this is fixed in Focal and still broken in Bionic.

Changed in xfwm4 (Ubuntu Bionic):
status: New → Confirmed
Changed in xfwm4 (Ubuntu Focal):
status: New → Fix Released
Sean Davis (bluesabre)
Changed in xfwm4 (Ubuntu Bionic):
status: Confirmed → Won't Fix
Changed in xfwm4 (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.