Bug 146627 - [GTK] Guard X11-specific code in webkitWebViewBaseDidRelaunchWebProcess()
Summary: [GTK] Guard X11-specific code in webkitWebViewBaseDidRelaunchWebProcess()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-06 01:34 PDT by Zan Dobersek
Modified: 2015-07-08 07:49 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.73 KB, patch)
2015-07-06 01:38 PDT, Zan Dobersek
cgarcia: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2015-07-06 01:34:29 PDT
Should be guarded with PLATFORM(X11).
Comment 1 Zan Dobersek 2015-07-06 01:38:23 PDT
Created attachment 256201 [details]
Patch
Comment 2 WebKit Commit Bot 2015-07-06 01:39:40 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Carlos Garcia Campos 2015-07-06 01:40:50 PDT
Comment on attachment 256201 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=256201&action=review

> Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp:1396
> +#if PLATFORM(X11)

I think you can move this to the beginning of the function, the drawing area pointer is useless otherwise.
Comment 4 Zan Dobersek 2015-07-06 02:49:40 PDT
Committed r186333: <http://trac.webkit.org/changeset/186333>
Comment 5 Michael Catanzaro 2015-07-06 05:49:21 PDT
Now that since we now support compiling with ENABLE_X11_TARGET and ENABLE_WAYLAND_TARGET at the same time, checks like these need to be done at both compile time *and* runtime. (So this patch is not wrong, but incomplete.)

One way to do that would be:

bool runningInX11 = GDK_IS_X11_DISPLAY(gdk_window_get_display(gtk_widget_get_window(GTK_WIDGET(webkitWebViewBase))));

Maybe we have a better way?

Do we need to audit our code to check for places this was missed in the past? What about around uses of USE(REDIRECTED_XCOMPOSITE_WINDOW)?
Comment 6 Carlos Garcia Campos 2015-07-06 05:55:03 PDT
(In reply to comment #5)
> Now that since we now support compiling with ENABLE_X11_TARGET and
> ENABLE_WAYLAND_TARGET at the same time, checks like these need to be done at
> both compile time *and* runtime. (So this patch is not wrong, but
> incomplete.)
> 
> One way to do that would be:
> 
> bool runningInX11 =
> GDK_IS_X11_DISPLAY(gdk_window_get_display(gtk_widget_get_window(GTK_WIDGET(we
> bkitWebViewBase))));
> 
> Maybe we have a better way?

Yes, PlatformDisplay::sharedDisplay().type() == PlatformDisplay::X11

> Do we need to audit our code to check for places this was missed in the
> past? What about around uses of USE(REDIRECTED_XCOMPOSITE_WINDOW)?
Comment 7 Zan Dobersek 2015-07-07 22:45:34 PDT
(In reply to comment #6)
> (In reply to comment #5)
> > Now that since we now support compiling with ENABLE_X11_TARGET and
> > ENABLE_WAYLAND_TARGET at the same time, checks like these need to be done at
> > both compile time *and* runtime. (So this patch is not wrong, but
> > incomplete.)
> > 
> > One way to do that would be:
> > 
> > bool runningInX11 =
> > GDK_IS_X11_DISPLAY(gdk_window_get_display(gtk_widget_get_window(GTK_WIDGET(we
> > bkitWebViewBase))));
> > 
> > Maybe we have a better way?
> 
> Yes, PlatformDisplay::sharedDisplay().type() == PlatformDisplay::X11
> 

Bug #146711.