:-moz-window-inactive triggers on window drag
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox72 | --- | fixed |
People
(Reporter: letmepicknicename, Assigned: evjmason)
References
()
Details
Attachments
(1 file, 1 obsolete file)
Reporter | ||
Updated•11 years ago
|
Updated•11 years ago
|
Updated•10 years ago
|
Comment 1•10 years ago
|
||
This is an old issue, but it's still causing problems.
It is the root cause of Bug 1491808 (Titlebar looks inactive when the main windows is dragged). The fix for 1491808 works around the issue, but is not a definitive solution. Csd titlebar issues remain; for example: https://github.com/rafaelmardojai/firefox-gnome-theme/issues/22.
The problem is that focus in/out events as delivered by gtk do not conceptually correspond to the meaning of focus in/out as expected by gecko. This is irrespective of wm/compositor, and it is not Wayland-specific. I am seeing this under X11 and compiz, for example. This fix decouples gecko from gtk focus in/out events and instead synthesizes focus in/out based on changes to window_state_event GDK_WINDOW_STATE_FOCUSED, as suggested by Aleksandr Seleznev.
The attached patch does the following:
- reverts the changes for Bug 1491808
- decouples gtk's focus in/out events from gecko
- synthesizes focus in/out events in response to changes in GDK_WINDOW_STATE_FOCUSED
- synthesizes focus in events upon restore from iconic state
The change is conceptually simple, but the condition is made a little more complex because of the inclusion of focus in upon restoration from iconic state.
As the patch resolves the root cause, the changes in support of Bug 1491808 are no longer necessary and have been removed.
Caution: I made and tested these changes against the esr branch. The underlying code on central has had subsequent changes which may affect the behaviour. Also, I have limited environments to test, and this needs to be tested well for regressions.
Thanks for considering the patch. I hope it is helpful.
Comment 3•5 years ago
|
||
https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-window-inactive does not define "inactive window", but the mention of "different styles to background windows" suggests that "inactive" may mean "not background".
It would seem reasonable to me to align :-moz-window-inactive
with GDK_WINDOW_STATE_FOCUSED/_NET_WM_STATE_FOCUSED for "whether the window's decorations are drawn in an active state".
The best description I've found for the difference between _NET_WM_STATE_FOCUSED and the keyboard focus window is https://mail.gnome.org/archives/wm-spec-list/2011-October/msg00005.html
The behavior on window dragging actually depends on whether the window manager grabs the keyboard focus or not. For example, with kwin window drags, :-moz-window-inactive
does not match.
Comment 4•5 years ago
|
||
Something to be aware of is that https://gitlab.gnome.org/GNOME/gtk/commit/95648fd1942651ea1ca9aab9b7aa79df6f843f40 suggests that GDK_WINDOW_STATE_FOCUSED will always be set on window managers that don't support _NET_WM_STATE_FOCUSED, and this was observed in https://bugzilla.mozilla.org/show_bug.cgi?id=1170342#c3
That may be acceptable if only :-moz-window-inactive would depend on GDK_WINDOW_STATE_FOCUSED, but we would need some sort of fallback if keyboard focus indicators depended on this.
This patch fixes activation of the :-moz-window-inactive pseudoclass
in client side decoration during drag operations. It depends on and
complements the fixes provided in support of Bug 1491808.
Obsoletes D50445
Updated•5 years ago
|
Updated•5 years ago
|
Comment 7•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Updated•4 years ago
|
Comment 8•2 years ago
|
||
I still have this issue on Linux/X11.
When I drag the main window of Thunderbird in version 102, then text in the menu bar changes its color but shouldn't. There is also a similar issue with the download list items in the download window of Firefox 102. I am on Xubuntu 22.04/X11.
When write in userChrome.css for Thunderbird:
menubar > menu:-moz-window-inactive {
color: red !important;
}
Then the text of the menu bar changes to red but not only when the window is inactive but also on drag. So the -moz-window-inactive seems to get triggered even on drag.
Can we reopen this issue?
See also Bug 1497534
Comment 9•2 years ago
|
||
Please file a new bug rather than reopening a bug that was fixed by a patch. I can't repro this on Wayland, for the record.
Description
•