After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 765557 - background color handling in presentation mode is broken with gtk+-3.20
background color handling in presentation mode is broken with gtk+-3.20
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-25 20:26 UTC by Bertram Felgenhauer
Modified: 2016-06-19 11:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
libview: draw the background for EvViewPresentation (2.35 KB, patch)
2016-05-04 11:35 UTC, Felipe Borges
reviewed Details | Review
libview: use css style classes for background in presentation mode (2.54 KB, patch)
2016-05-04 11:36 UTC, Felipe Borges
reviewed Details | Review
libview: use css to draw the background of presentations (4.30 KB, patch)
2016-05-09 09:47 UTC, Felipe Borges
committed Details | Review

Description Bertram Felgenhauer 2016-04-25 20:26:49 UTC
With evince-3.20.0 on gtk+-3.20, when switching to presentation mode, a grey border is displayed, instead of a black one. This also affects the two blank modes ('w' - white and 'b' - black), which both result in a monochrome gray.

Some speculation:

The bug https://github.com/mate-desktop/mate-panel/issues/403 looks similar, which points to the following commit in gtk+ as the culprit: https://git.gnome.org/browse/gtk+/commit/?id=580ea227a6bb19ad6c6d4766b3a36dbad24583f3 ... in any case, it appears that gdk_window_set_background_rgba() does not have any effect anymore. I don't know what the proper fix is.
Comment 1 Felipe Borges 2016-05-04 11:35:49 UTC
Created attachment 327288 [details] [review]
libview: draw the background for EvViewPresentation

Add a css style class to the EvViewPresentation class and style
the background with css.
Comment 2 Felipe Borges 2016-05-04 11:36:17 UTC
Created attachment 327289 [details] [review]
libview: use css style classes for background in presentation mode

With the recent changes in gtk+, widgets have to draw themselves,
causing the current use of gdk_window_set_background_rgba to fail.
Comment 3 Carlos Garcia Campos 2016-05-07 06:34:52 UTC
Review of attachment 327288 [details] [review]:

Thanks for the patch, we indeed need to make evince compatible with gtk 3.20, but I'm afraid that would break evince when compiled with previous versions of GTK+. I don't mind to bump the GTK+ version in master, but we should also make 3.20 look good with gtk+ 3.20 without bumping the requirements.

::: libview/ev-view-presentation.c
@@ +1069,3 @@
+
+	context = gtk_widget_get_style_context (GTK_WIDGET (pview));
+	gtk_style_context_add_class (context, "ev-view-presentation");

I don't think ev-view-presentation is a class, I think we should set thisas the node name instead, and then simply add/remove a "white" class to make the background black/white. I think we only need to call gtk_widget_class_set_css_name() in the class init.
Comment 4 Carlos Garcia Campos 2016-05-07 06:36:41 UTC
Review of attachment 327289 [details] [review]:

I think you can squash both patches since they are related and simple enough. Thanks!

::: libview/ev-view-presentation.c
@@ +152,3 @@
+					"ev-view-presentation");
+	gtk_style_context_add_class (gtk_widget_get_style_context (widget),
+				     "ev-view-presentation-white");

It looks weird to me having ev-view-presentation and ev-view-presentation-white classes, as I said I think ev-view-presentation should be the css name, and then we can add/remove a "white" class.
Comment 5 Felipe Borges 2016-05-09 09:47:08 UTC
Created attachment 327502 [details] [review]
libview: use css to draw the background of presentations

With the recent changes in gtk+, widgets have to draw themselves,
causing the current use of gdk_window_set_background_rgba to fail.
Comment 6 Carlos Garcia Campos 2016-05-10 16:10:11 UTC
Review of attachment 327502 [details] [review]:

The patch looks good to me, but the question about previous versions of GTK+ remains, what do we do? You are now using API only available in 3.20 so it won't compile with previous versions. Is it possible to make this work for GTK+ < 3.20 too? In the code we can simply use ifdefs, but I have no idea what do with the css, maybe we need two css files and build one or the other depending on the GTk+ version we are building with.
Comment 7 Antonio 2016-05-26 15:26:47 UTC
Please, do it!!, I just download the source, just to read a pdf in fullscreen without the gray background, there are tons of people that use linux in university and read a lot of pdf. I need a black background in fullscreen, and I need evince remember if I'd like a dual page view in fullscreen and not switch automatically to single page. 
There are people with 27'' monitors out there..so please, actually I was forced to install an old version of acrobat reader just to do it.

Requirements Summary:
* black background in fullscreen
* remember dual view status from normal to fullscreen and back.

or just write a patch that really works for both, and the changes to evince.css.
Sorry but this must be something like * super urgent major bug to fix * imho.
Comment 8 Germán Poo-Caamaño 2016-05-26 15:37:52 UTC
(In reply to Antonio from comment #7)
> [...]
> There are people with 27'' monitors out there..so please, actually I was
> forced to install an old version of acrobat reader just to do it.

You can downgrade Gtk+ to 3.18 and Evince (among other applications) will work as expected as well.
Comment 9 Germán Poo-Caamaño 2016-06-10 17:58:47 UTC
Maybe the patch is already one of Bug 758793
Comment 10 Carlos Garcia Campos 2016-06-19 11:28:34 UTC
Comment on attachment 327502 [details] [review]
libview: use css to draw the background of presentations

I've added support to load a different CSS depending on the GTK+ version. So, I modified this patch to keep the old code for GTK+ < 3.20 and also updated the css name for consistency with names used by GTK+. Thanks!