Bug 172993

Summary: [GTK][Wayland] Do not pass value of $DISPLAY to wl_display_connect()
Product: WebKit Reporter: Adrian Perez <aperez>
Component: WebKitGTKAssignee: Adrian Perez <aperez>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, cgarcia, clopez, commit-queue, mcatanzaro, zan
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

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]
Patch
Comment 2 Zan Dobersek 2017-06-06 09:43:58 PDT
Comment on attachment 312081 [details]
Patch

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]
Patch

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.