Bug #1240
Notifications not sent when Quassel is minimized
100%
Description
Using Quassel verion 0.9.0 on gentoo. Running KDE 4.10.5 at the moment.
When quassel is NOT minimized but it has no focus notifications are sent normally and I can see them in the KDE notification area. But when quassell is minimized no notification is sent at all. This can be reproduced on Kubuntu 13.04 as well.
This issue might be related to #1179 .
Related issues
Associated revisions
Fix notifications when minimized.
QWidget::isVisible() just checks if the widget has been explicitly
hidden, not if it is minimized, covered, or whatnot.
Fixes #1240
History
#1 Updated by enrico.tagliavini about 11 years ago
Possible important note: the quassel systray icon does NOT blink red when minimized as well, but works as expected when not minimized
#2 Updated by enrico.tagliavini about 11 years ago
Possibly found something more:
In mainwin.cpp:
void MainWin::bufferViewToggled(bool enabled)
{
qDebug() << "### called bufferViewToggled";
if (!enabled && !isVisible()) {
// hiding the mainwindow triggers a toggle of the bufferview (which pretty much sucks big time)
// since this isn't our fault and we can't do anything about it, we suppress the resulting calls
return;
}
QAction *action = qobject_cast<QAction *>(sender());
Q_ASSERT(action);
BufferViewDock *dock = qobject_cast<BufferViewDock *>(action->parent());
Q_ASSERT(dock);
// Make sure we don't toggle backlog fetch for a view we've already removed
if (!_bufferViews.contains(dock))
return;
if (enabled)
Client::bufferViewOverlay()->addView(dock->bufferViewId());
else {
Client::bufferViewOverlay()->removeView(dock->bufferViewId());
}
}
When the window is minimized enable = false and isVisible() returns true. So removeView(dock->bufferViewId()). No View Ids, no notifications as far as I understood (the BufId presence is checked in MainWin::messagesInserted())
#3 Updated by Anonymous about 11 years ago
This is probably a bug/regression in Qt; a minimized QWidget should not be reported as visible. I also note it works fine in Qt 5.
#4 Updated by enrico.tagliavini about 11 years ago
I'm pretty new and confused by Qt but quiting from http://qt-project.org/doc/qt-4.8/qwidget.html#visible-prop:
"A widget that happens to be obscured by other windows on the screen is considered to be visible. The same applies to iconified windows and windows that exist on another virtual desktop (on platforms that support this concept)."
So a minimized window is considered visible. I also checked windowState() inside bufferViewToggled and the minimized status is added later. When I minimize the window and the bufferViewToggled is called it seems that Qt sees the windows still not minimized. Can this be a bug / regression for you?
"A widget receives spontaneous show and hide events when its mapping status is changed by the window system, e.g. a spontaneous hide event when the user minimizes the window, and a spontaneous show event when the window is restored again."
So a minimized window can be invisible if the WM thinks this should be the case, am I understanding this correctly? But in KDE an iconified window is kept visible since there are other means of displaying it, via Desktop effect for example. So I guess KWin never send an hide event to Quassel.
#5 Updated by Anonymous about 11 years ago
There's a ton of ways to do things (multiple roots, one root and unmapping, compositing, ..). KWin may not unmap the window, but then it should set _NET_WM_STATE_HIDDEN as per EWMH. Apparently Qt is stupid and does not regard that as hidden (see your first quote); I read the second quote and figured it should Just Work™ because that's what Qt is for…
Oddly enough the documentation for Qt 5.1 is the same, so one of them is misbehaving (or the docs are wrong).
#6 Updated by aidenn about 11 years ago
Hello,
I wanted to add that this issue is also present in the official 0.9.0 build on Windows 8.1 x64 (probably on W7 and W8 too) - no notification is sent when the window is minimized, yet it works fine when it's not focused - tray icon flashing, sound, balloon, etc.
Cheers,
Aidenn
#7 Updated by Anonymous almost 11 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Applied in changeset quassel|commit:fd97519376748925efe765d138ad5af637d809bd.
Fix notifications when minimized.
QWidget::isVisible() just checks if the widget has been explicitly
hidden, not if it is minimized, covered, or whatnot.
Fixes #1240