diff options
-rw-r--r-- | content/plugin/webplugin_proxy.cc | 7 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc | 16 |
2 files changed, 13 insertions, 10 deletions
diff --git a/content/plugin/webplugin_proxy.cc b/content/plugin/webplugin_proxy.cc index 4b717a0..c60c136 100644 --- a/content/plugin/webplugin_proxy.cc +++ b/content/plugin/webplugin_proxy.cc @@ -75,8 +75,8 @@ WebPluginProxy::WebPluginProxy( Display* display = ui::GetXDisplay(); if (ui::QuerySharedMemorySupport(display) == ui::SHARED_MEMORY_PIXMAP && ui::BitsPerPixelForPixmapDepth( - display, DefaultDepth(display, 0)) == 32) { - Visual* vis = DefaultVisual(display, 0); + display, DefaultDepth(display, DefaultScreen(display))) == 32) { + Visual* vis = DefaultVisual(display, DefaultScreen(display)); if (vis->red_mask == 0xff0000 && vis->green_mask == 0xff00 && @@ -603,7 +603,8 @@ void WebPluginProxy::CreateShmPixmapFromDIB( *pixmap_out = XShmCreatePixmap(display, root_window, NULL, &shminfo, window_rect.width(), window_rect.height(), - DefaultDepth(display, 0)); + DefaultDepth(display, + DefaultScreen(display))); } } diff --git a/webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc b/webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc index 5f1d2bc..85655dc 100644 --- a/webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc +++ b/webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc @@ -155,9 +155,10 @@ bool WebPluginDelegateImpl::WindowedCreatePlugin() { static_cast<NPSetWindowCallbackStruct*>(window_.ws_info); extra->type = NP_SETWINDOW; extra->display = GDK_DISPLAY(); - extra->visual = DefaultVisual(GDK_DISPLAY(), 0); - extra->depth = DefaultDepth(GDK_DISPLAY(), 0); - extra->colormap = DefaultColormap(GDK_DISPLAY(), 0); + int screen = DefaultScreen(GDK_DISPLAY()); + extra->visual = DefaultVisual(GDK_DISPLAY(), screen); + extra->depth = DefaultDepth(GDK_DISPLAY(), screen); + extra->colormap = DefaultColormap(GDK_DISPLAY(), screen); return true; } @@ -425,7 +426,7 @@ void WebPluginDelegateImpl::WindowlessPaint(cairo_t* context, pixmap = XCreatePixmap(display, windowless_shm_pixmap_, std::max(1, pixmap_rect.width()), std::max(1, pixmap_rect.height()), - DefaultDepth(display, 0)); + DefaultDepth(display, DefaultScreen(display))); xgc = XCreateGC(display, windowless_shm_pixmap_, 0, NULL); // Copy the current image into the pixmap, so the plugin can draw over it. XCopyArea(display, windowless_shm_pixmap_, pixmap, xgc, @@ -523,9 +524,10 @@ void WebPluginDelegateImpl::WindowlessSetWindow() { NPSetWindowCallbackStruct* extra = static_cast<NPSetWindowCallbackStruct*>(window_.ws_info); extra->display = GDK_DISPLAY(); - extra->visual = DefaultVisual(GDK_DISPLAY(), 0); - extra->depth = DefaultDepth(GDK_DISPLAY(), 0); - extra->colormap = DefaultColormap(GDK_DISPLAY(), 0); + int screen = DefaultScreen(GDK_DISPLAY()); + extra->visual = DefaultVisual(GDK_DISPLAY(), screen); + extra->depth = DefaultDepth(GDK_DISPLAY(), screen); + extra->colormap = DefaultColormap(GDK_DISPLAY(), screen); NPError err = instance()->NPP_SetWindow(&window_); DCHECK(err == NPERR_NO_ERROR); |