Bug 1559045

Summary: gtk+ "Foreign drawing" broken under MATE
Product: [Fedora] Fedora Reporter: Milan Crha <mcrha>
Component: mate-themesAssignee: Wolfgang Ulbrich <fedora>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: fedora, rdieter
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: mate-themes-3.22.16-1.fc26 mate-themes-3.22.16-1.fc27 mate-themes-3.22.16-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-08 05:19:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
in GNOME
none
in MATE
none
test-wk2.c
none
test-wk2 in GNOME
none
test-wk2 in MATE none

Description Milan Crha 2018-03-21 15:12:17 UTC
I tried gtk3-demo->Foreign drawing demo under MATE and it doesn't look correct. It should look the same as under GNOME or Plasma, but it's just broken (screenshots to be attached). I realized it's due to the themes in MATE not defining minimum size (min-width/min-height). This issue affects WebKitGTK+ badly, which is the place where I noticed this few Fedora versions back, but I hoped it'll be fixed in gtk+.

Comment 1 Milan Crha 2018-03-21 15:12:58 UTC
Created attachment 1411250 [details]
in GNOME

Comment 2 Milan Crha 2018-03-21 15:14:29 UTC
Created attachment 1411253 [details]
in MATE

Notice missing checkboxes, which are not there, because the style returns [0,0] for ["min-width", "min-height"] style properties.

Comment 3 Milan Crha 2018-03-21 15:23:08 UTC
Created attachment 1411255 [details]
test-wk2.c

A simple test program showing the issue in WebKitGTK+. The first line of the file contains a command line to compile & run it. Just have webkitgtk4-devel package installed.

Issues (some might be in WebKitGTK+ itself, but until the "Foreign drawing" will work properly it's hard to tell which, if any, they are):
a) the checkbox/radio is not shown on the page
b) neither the bottom scrollbar (I have exported GTK_OVERLAY_SCROLLING=0, but
   it doesn't have much influence on the invisibility of that scrollbar)
c) text color on buttons is white, while it should be black

Running the same under GNOME makes it look properly (screenshots follow).

Note that re-login can cause the style to be "inherited" from the previous session. When I used these steps:
a) login to GNOME under Wayland
b) run terminal
c) run the gtk3-demo->Foreign drawing, observe it's fine
d) logout the user
e) login to MATE
f) run terminal
g) run the gtk3-demo->Foreign drawing, observe it's fine
h) resize the 'Foreign drawing' window and close it
i) close also the gtk-demo
j) run the gtk3-demo->Foreign drawing, observe it's broken

I do not mention these steps to pile another issue into this report, I only want to demonstrate that the actual behaviour depends on previous session. Logging after restart straight to MATE may reproduce the issue immediately.

Comment 4 Milan Crha 2018-03-21 15:23:41 UTC
Created attachment 1411256 [details]
test-wk2 in GNOME

Comment 5 Milan Crha 2018-03-21 15:28:00 UTC
Created attachment 1411269 [details]
test-wk2 in MATE

I forgot to mention, my theme is BlueMenta, but I see at least the issue with the check/radio and the horizontal scrollbar with other MATE themes as well.

Comment 6 Wolfgang Ulbrich 2018-03-28 21:31:47 UTC
Ok, the min-size for check/radio was only set for
menuitem check,
menuitem radio {
	min-height: 12px;
	min-width: 12px;
}

in BlueMenta
https://github.com/mate-desktop/mate-themes/blob/master/desktop-themes/BlueMenta/gtk-3.0/gtk-widgets.css#L3158
Adding
check,
radio {
	padding: 0px 6px 0px 0px;
	min-height: 12px;
	min-width: 12px;
}
fixes the the issue.
Adding 	color: @theme_fg_color; to buttons will fix the font color in buttons of your test file.
https://github.com/mate-desktop/mate-themes/blob/master/desktop-themes/BlueMenta/gtk-3.0/gtk-widgets.css#L1250

button {
	transition: all 400ms ease-out;
	border-style: solid;
	border-color: transparent;
	text-shadow: 0 1px @button_text_shadow;
	color: @theme_fg_color;
}

The problem with horizontal scollbar in webkit applications like 'yelp' is a known problem, see 
https://github.com/mate-desktop/mate-themes/issues/197#issuecomment-334713523
https://github.com/mate-desktop/mate-themes/issues/197#issuecomment-334961912

But using
scrollbar.horizontal button {
	min-height: 0px;
	min-width: 16px;
}
will break libreoffice.
Webkit apps doesn't like to set a min-height for the button/scrollstepper.
You don't see that with Adwaita theme because they don't use buttons in scrollbars.
And for the reason that you don't see it in Adwaita, nobody will blame gtk+ or webkit for that.

Sadly, all workarounds you will find in github report won't work fine and causes side effects in other applications.
I will commit fixes for check/radio and font-color in MATE themes.

Comment 7 Milan Crha 2018-03-29 07:17:38 UTC
(In reply to Wolfgang Ulbrich from comment #6)
> And for the reason that you don't see it in Adwaita, nobody will blame gtk+
> or webkit for that.

With respect of scrollbar, I did think it's an issue with WebKitGTK+ itself, but I didn't find enough courage to even try to find the place where it's used in WebKitGTK+ itself.

> I will commit fixes for check/radio and font-color in MATE themes.

Thanks a lot.

Comment 9 Fedora Update System 2018-03-30 08:59:49 UTC
mate-themes-3.22.16-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2018-efec265fdf

Comment 10 Fedora Update System 2018-03-30 08:59:59 UTC
mate-themes-3.22.16-1.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2018-f36a0bbffd

Comment 11 Fedora Update System 2018-03-30 09:00:10 UTC
mate-themes-3.22.16-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-6c25c2ef18

Comment 12 Wolfgang Ulbrich 2018-03-30 09:03:04 UTC
I have released 3.22.16 with the fixes.
Feel free to re-open the report because of horz. scrollbar issue.
Maybe it's better to re-assign it to webkitgtk2 in this case.

Comment 13 Fedora Update System 2018-03-30 14:07:43 UTC
mate-themes-3.22.16-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2018-6c25c2ef18

Comment 14 Fedora Update System 2018-03-30 14:39:17 UTC
mate-themes-3.22.16-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-efec265fdf

Comment 15 Fedora Update System 2018-03-30 14:48:41 UTC
mate-themes-3.22.16-1.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-f36a0bbffd

Comment 16 Fedora Update System 2018-04-08 05:19:56 UTC
mate-themes-3.22.16-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2018-04-08 05:53:20 UTC
mate-themes-3.22.16-1.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 18 Fedora Update System 2018-04-15 14:38:18 UTC
mate-themes-3.22.16-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.