GNOME Bugzilla – Bug 765557
background color handling in presentation mode is broken with gtk+-3.20
Last modified: 2016-06-19 11:32:26 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.
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.
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.
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.
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.
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.
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.
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.
(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.
Maybe the patch is already one of Bug 758793
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!