Bug 154890

Summary: [GTK] Scrollbars are broken again with GTK+ >= 3.19.11
Product: WebKit Reporter: Hussam Al-Tayeb <ht990332>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, cgarcia, cosimoc, mcatanzaro
Priority: P3    
Version: Other   
Hardware: PC   
OS: Linux   
See Also: https://bugzilla.gnome.org/show_bug.cgi?id=763234
Attachments:
Description Flags
unfocused scrollbar
none
focused scrollbar
none
Patch mcatanzaro: review+

Description Hussam Al-Tayeb 2016-03-01 16:21:07 PST
Created attachment 272603 [details]
unfocused scrollbar

I think they tweeked theming a bit in gtk post 3.19.10 release so webkitgtk+ has to adjust?
Comment 1 Hussam Al-Tayeb 2016-03-01 16:21:41 PST
Created attachment 272604 [details]
focused scrollbar
Comment 2 Hussam Al-Tayeb 2016-03-01 16:27:14 PST
Normal gtk+ applications still show normally sized scrollbars. Only webkitgtk+ implementation is affected.
Comment 4 Carlos Garcia Campos 2016-03-01 22:57:22 PST
Yes, hopefully after 3.20 we don't need to adjust our theme code for every single GTK+ commit :-(
Comment 5 Carlos Garcia Campos 2016-03-04 02:58:45 PST
Renaming since this is not specific to overlay scrollbars not 2.11.91 version, it was GTK+ what broke us again, deprecating style properties that are now ignored by GTK+.
Comment 6 Carlos Garcia Campos 2016-03-04 03:08:00 PST
Created attachment 272846 [details]
Patch

After two days fighting with this, I've finally managed to get something that keeps the exactly same behavior with previous version of GTK+ (at least the GTK+ version we have in out internal jhbuild which is the one I've tried), and matches exactly what GTK+ from today git master does. I can't promise it will work tomorrow, though.
Comment 7 Michael Catanzaro 2016-03-04 07:40:36 PST
See what thou hast wrought.
Comment 8 Michael Catanzaro 2016-03-04 07:41:08 PST
Comment on attachment 272846 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=272846&action=review

> Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp:138
> +    GtkBorder stepperSpacing = { 0, 0, 0, 0};

0 };

> Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp:296
> +        return IntRect(trackRect.x() + thumbPos, trackRect.y() + troughBorder.top + (trackRect.height() - thumbFat) / 2, thumbLength(scrollbar), thumbFat);

I don't see how this works in older GTK+.
Comment 9 Carlos Garcia Campos 2016-03-04 22:20:09 PST
Comment on attachment 272846 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=272846&action=review

>> Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp:296
>> +        return IntRect(trackRect.x() + thumbPos, trackRect.y() + troughBorder.top + (trackRect.height() - thumbFat) / 2, thumbLength(scrollbar), thumbFat);
> 
> I don't see how this works in older GTK+.

See the #if above, in older GTK+ troughBorder is 0, so this doesn't have any new effect. As I said I tried with GTK+ 3.16 compiled in our jhbuild.
Comment 10 Carlos Garcia Campos 2016-03-04 22:25:27 PST
Committed r197609: <http://trac.webkit.org/changeset/197609>