Closed Bug 1491374 Opened 6 years ago Closed 6 years ago

[KDE] Scrollbar thumb disappears when window is not focused

Categories

(Core :: Widget: Gtk, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox-esr60 --- unaffected
firefox62 --- unaffected
firefox63 --- unaffected
firefox64 + fixed

People

(Reporter: botond, Assigned: stransky)

References

Details

(Keywords: regression)

Attachments

(3 files, 1 obsolete file)

STR:
  1. Open any scrollable page, so that a scrollbar track
     and scrollbar thumb are rendered
  2. Switch focus to another window (while keeping the
     Firefox window shown)

Expected results:
  The scrollbar thumb continues to be rendered

Actual results:
  The scrollbar thumb disappears
Mozregression points to this being regressed by bug 1489963:

https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=a3934bdc3c6897f884d861f494fc337c5e686351&tochange=70c9cb74c8446bd1ce67040a003a901ffd878fda

Martin, could you have a look please?
Blocks: 1489963
Flags: needinfo?(stransky)
This may be actually an expected result. Please compare Firefox behavior with other Gtk+ applications, gedit for instance. It also does not show scrollbar thumb when window is not focused on some themes. Before Bug 1489963 firefox incorrectly rendered scrollbars as active on unfocused windows.
Flags: needinfo?(stransky) → needinfo?(botond)
Gedit behaves differently from Firefox is several ways:

  * Gedit has overlay scrollbars (only shown while scrolling), while 
    Firefox has persistent scrollbars.

  * Gedit doesn't allow scrolling at all (with the mousewheel) when
    the window is not focused, Firefox does.

It's the second point that makes the lack of rendering of scrollbars particularly noticeable, since you can scroll the content in the Firefox window, but no scrollbar is rendered during the scrolling.
Flags: needinfo?(botond)
Okay, Thanks. Which theme & distro do you run?
Flags: needinfo?(botond)
(In reply to Botond Ballo [:botond] from comment #3)
> Gedit behaves differently from Firefox is several ways:
> 
>   * Gedit has overlay scrollbars (only shown while scrolling), while 
>     Firefox has persistent scrollbars.

Firefox tries to emulate that for some themes (Ubuntu Ambiance for instance)
but there's definitely room for improvement.

>   * Gedit doesn't allow scrolling at all (with the mousewheel) when
>     the window is not focused, Firefox does.

I have different experience. All Gtk+ apps can be scrolled even when unfocused on Fedora 28/Gtk 3.22. Tested on gedit and gnome-terminal - Firefox recent behavior fits very well in such scenario.
(In reply to Martin Stránský [:stransky] from comment #4)
> Okay, Thanks. Which theme & distro do you run?

I am running Debian stable with KDE.

I haven't changed any settings related to theme. In System Settings -> Workspace Behaviour -> Desktop Theme, "Breeze" is selected.

(In reply to Martin Stránský [:stransky] from comment #5)
> >   * Gedit doesn't allow scrolling at all (with the mousewheel) when
> >     the window is not focused, Firefox does.
> 
> I have different experience. All Gtk+ apps can be scrolled even when
> unfocused on Fedora 28/Gtk 3.22. Tested on gedit and gnome-terminal -
> Firefox recent behavior fits very well in such scenario.

Interesting. I'm also running Gtk 3.22. Perhaps it's a GNOME vs. KDE difference.

But anyways, presumably gedit and gnome-terminal render the scrollbar thumb when you are scrolling-while-unfocused. Firefox does not - this is the problem. You can scroll, and yet have no indication of where in the page you are.
Flags: needinfo?(botond)
[Tracking Requested - why for this release]:

I would like to track this as it's a fairly noticeable regression in scrollbar rendering behaviour: when the Firefox window is not focused, scrolling with the mousewheel works but the scrollbar thumb is not rendered.
Sure, I'll take that.
Assignee: nobody → stransky
I can also reproduce that on MATE and LXDE.
I did some work with gtk inspector and it revealed that Gtk state "backdrop" is not set/used on the widgets there. The backdrop is set at gtk_window_state_event() so it's a question how is that handled on MATE/KDE.
It looks like a bug at MATE/KDE/LXDE. When CSD mode is enabled (I'm not sure it depends on CSD) the toplevel GtkWindow does not get window-state-event for focus changes, only maximized/minimized/normal states are send. This is also a reason why for instance headerbar of gedit does not change look on MATE when it's moved foreground/background.

That means default MATE theme does not count with the backdrop state as it's never set here and thus the default MATE theme does not work well with it. When I change Firefox theme under MATE to a different one (Ambiance for instance) the scrollbar thump is visible in Firefox as well as when it's running in Gnome.
Summary: Scrollbar thumb disappears when window is not focused → [KDE] Scrollbar thumb disappears when window is not focused
Attachment #9010557 - Attachment is obsolete: true
Let's revert the Bug 1489963 as the default Adwaita theme is not rendered correctly by Firefox at backdrop state.
Comment on attachment 9010643 [details]
Bug 1491374 - Don't use backdrop state for scrollbars, r=jhorak

Jan Horak [:jhorak] has approved the revision.
Attachment #9010643 - Flags: review+
Pushed by dluca@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/09210ae19019
Don't use backdrop state for scrollbars, r=jhorak
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/09210ae19019
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Thanks very much for the fix!
This has regressed again, but in a different way: the thumb is now showing when unfocused, but it's very light and hard to see.
(In reply to Botond Ballo [:botond] from comment #22)
> This has regressed again, but in a different way: the thumb is now showing
> when unfocused, but it's very light and hard to see.

The regressing changeset is the relanding of bug 1489963.

I attached a screenshot showing the color of the scrollbar thumb when inactive. Martin, is it intentional that the contrast between the thumb and the scrollbar is so low? Could we do something to increase it? It's hard to see.
Flags: needinfo?(stransky)
As a point of comparison, here is the much stronger contrast between the scrollbar thumb and the rest of the scrollbar when the window is focused.
(In reply to Botond Ballo [:botond] from comment #23)
> Created attachment 9012362 [details]
> Screenshot of scrollbar thumb when not focused
> 
> (In reply to Botond Ballo [:botond] from comment #22)
> > This has regressed again, but in a different way: the thumb is now showing
> > when unfocused, but it's very light and hard to see.
> 
> The regressing changeset is the relanding of bug 1489963.
> 
> I attached a screenshot showing the color of the scrollbar thumb when
> inactive. Martin, is it intentional that the contrast between the thumb and
> the scrollbar is so low? Could we do something to increase it? It's hard to
> see.

Yes, that's probably expected, that's default look of inactive scrollbars at Adwaita theme.

You don's see that on KDE because of https://bugs.kde.org/show_bug.cgi?id=398832 which blocks the backdrop state for regular Gtk+ applications like gedit, so Gtk+ applications does not look inactive on background on KDE.
Flags: needinfo?(stransky)
Attachment #9010557 - Attachment is obsolete: false
Attachment #9010557 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: