Bug 172993 - [GTK][Wayland] Do not pass value of $DISPLAY to wl_display_connect()
Summary: [GTK][Wayland] Do not pass value of $DISPLAY to wl_display_connect()
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
Depends on:
Reported: 2017-06-06 09:32 PDT by Adrian Perez
Modified: 2017-06-06 10:13 PDT (History)
6 users (show)

See Also:

Patch (1.79 KB, patch)
2017-06-06 09:38 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 2017-06-06 09:32:33 PDT
Currently “Source/WebCore/platform/graphics/wayland/PlatformDisplayWayland.cpp” reads:

  std::unique_ptr<PlatformDisplay> PlatformDisplayWayland::create()
      struct wl_display* display = wl_display_connect(getenv("DISPLAY"));
      if (!display)
          return nullptr;

      return std::make_unique<PlatformDisplayWayland>(display, NativeDisplayOwned::Yes);

The “DISPLAY” environment variable is typically used for X11, and “WAYLAND_DISPLAY”
should be used instead. According to the documentation, “wl_display_connect()” will
check the value of “WAYLAND_DISPLAY” itself, so it looks like we could just pass a
null pointer to it.
Comment 1 Adrian Perez 2017-06-06 09:38:04 PDT
Created attachment 312081 [details]
Comment 2 Zan Dobersek 2017-06-06 09:43:58 PDT
Comment on attachment 312081 [details]

I think this is fine. I checked if the DISPLAY env is set to anything meaningful in the UIProcess, but that doesn't seem to be the case.
Comment 3 WebKit Commit Bot 2017-06-06 10:13:04 PDT
Comment on attachment 312081 [details]

Clearing flags on attachment: 312081

Committed r217838: <http://trac.webkit.org/changeset/217838>
Comment 4 WebKit Commit Bot 2017-06-06 10:13:05 PDT
All reviewed patches have been landed.  Closing bug.