Bug 165300

Summary: [GTK] Process accelerated compositing env variables only if they are really enabled
Product: WebKit Reporter: Tomas Popela <tpopela>
Component: WebKitGTKAssignee: Tomas Popela <tpopela>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, commit-queue, mcatanzaro
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 165501    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Tomas Popela
Reported 2016-12-02 04:26:17 PST
Only process WEBKIT_FORCE_COMPOSITING_MODE and WEBKIT_DISABLE_COMPOSITING_MODE env variables if they are really enabled (eg. WEBKIT_DISABLE_COMPOSITING_MODE=1) and ignore others (eg. WEBKIT_DISABLE_COMPOSITING_MODE=0). This will help WebKitGTK+ consumers to be able to not disable AC through the env variable if the user wants the AC to be turned on (he will usually have "export WEBKIT_DISABLE_COMPOSITING_MODE=0" somewhere).
Attachments
Patch (1.79 KB, patch)
2016-12-02 04:30 PST, Tomas Popela
no flags
Patch (1.72 KB, patch)
2016-12-05 02:48 PST, Tomas Popela
no flags
Patch (1.84 KB, patch)
2016-12-08 03:46 PST, Tomas Popela
no flags
Tomas Popela
Comment 1 2016-12-02 04:30:24 PST
Michael Catanzaro
Comment 2 2016-12-02 08:39:56 PST
Comment on attachment 295940 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=295940&action=review > Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp:50 > - if (getenv("WEBKIT_FORCE_COMPOSITING_MODE")) > + if (!g_strcmp0(getenv("WEBKIT_FORCE_COMPOSITING_MODE"), "1")) How about if (g_strcmp0(getenv("WEBKIT_FORCE_COMPOSITING_MODE"), "0")), that way you can disable it by setting it to 0, but set it to anything else and it'd still be enabled? That seems more familiar to me; what do other popular applications do? > Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp:54 > - if (getenv("WEBKIT_DISABLE_COMPOSITING_MODE")) { > + if (!g_strcmp0(getenv("WEBKIT_DISABLE_COMPOSITING_MODE"), "1")) { Ditto.
Tomas Popela
Comment 3 2016-12-05 02:16:30 PST
(In reply to comment #2) > Comment on attachment 295940 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=295940&action=review > > > Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp:50 > > - if (getenv("WEBKIT_FORCE_COMPOSITING_MODE")) > > + if (!g_strcmp0(getenv("WEBKIT_FORCE_COMPOSITING_MODE"), "1")) > > How about if (g_strcmp0(getenv("WEBKIT_FORCE_COMPOSITING_MODE"), "0")), that > way you can disable it by setting it to 0, but set it to anything else and > it'd still be enabled? That seems more familiar to me; what do other popular > applications do? Could be as I don't have a strong preference on any of them. I don't any env variable apart from gtk's GTK_OVERLAY_SCROLLING: gtk/gtkscrolledwindow.c:4415: if (g_strcmp0 (g_getenv ("GTK_OVERLAY_SCROLLING"), "0") == 0) and that behaves the same way you described.. Let's rework the patch :)..
Tomas Popela
Comment 4 2016-12-05 02:48:23 PST
Michael Catanzaro
Comment 5 2016-12-05 03:48:05 PST
Comment on attachment 296135 [details] Patch This way also avoids breaking previous instructions. I doubt anybody was dumb enough to define WEBKIT_FORCE_COMPOSITING_MODE=0 and expect to get compositing mode, but it's not hard to imagine someone using WEBKIT_FORCE_COMPOSITING_MODE= or something.
Tomas Popela
Comment 6 2016-12-06 04:16:38 PST
Comment on attachment 296135 [details] Patch Clearing flags on attachment: 296135 Committed r209391: <http://trac.webkit.org/changeset/209391>
Tomas Popela
Comment 7 2016-12-06 04:16:47 PST
All reviewed patches have been landed. Closing bug.
WebKit Commit Bot
Comment 8 2016-12-06 16:38:28 PST
Re-opened since this is blocked by bug 165501
Michael Catanzaro
Comment 9 2016-12-07 05:27:00 PST
Sorry about the bad advice, Tom. :) To do it properly you'll need to check if the env variable is set, and then use plain strcmp instead of g_strcmp0 only if it's set, like Milan suggested.
Tomas Popela
Comment 10 2016-12-08 03:46:19 PST
Tomas Popela
Comment 11 2016-12-08 05:40:19 PST
Comment on attachment 296508 [details] Patch Clearing flags on attachment: 296508 Committed r209534: <http://trac.webkit.org/changeset/209534>
Tomas Popela
Comment 12 2016-12-08 05:40:28 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.