GNOME Bugzilla – Bug 704554
FIX mmap fails when getting root_window
Last modified: 2013-07-24 17:34:24 UTC
Created attachment 249635 [details] [review] Set width, height to 1 to avoid mmap fails Hi, As I was trying some samples(caret and controls) of wxWidgets on Wayland, I met this error at launch: "(controls:2962): Gdk-CRITICAL **: gdkwindow-wayland.c:578: mmap'ping temporary file failed: Invalid argument" It comes from gdk_screen_get_root_window() which returned a GtkWindow with height and width set to 0. But GtkWindow doc(https://developer.gnome.org/gtk3/3.5/GtkWindow.html#gtk-window-set-default-size) indicates that it should be set to 1. I did that it fixes my issue. The patch joined corrects the bug.
*** Bug 704425 has been marked as a duplicate of this bug. ***
Under Wayland we don't have a concept of a root window. I admit the dimensions of the root window could be better - perhaps the sum of the outputs? I'm more worried about why we're getting that warning that's indicating we're trying to create a backing buffer for the window. Can you break on that error message and generate a backtrace?
I'm quite happy to make the screen have the sum of the dimensions of the monitors and make the root window those dimensions But then the code path to create the similar window would potentially allocate a really large buffer - that seems kinda wrong.
Created attachment 250002 [details] backtrace of wxWidgets sample execution As you can see, it comes from wxCairoRenderer::CreateMeasuringContext, which only do this: { return CreateContextFromNativeWindow(gdk_get_default_root_window()); }
commit 16e43733b96163c6365a6c04f5097722360ec5b2 Author: Rob Bradford <rob@linux.intel.com> Date: Wed Jul 24 18:30:19 2013 +0100 wayland: Create a cairo surface for the root window Many parts of GTK+ assume that all windows have a cairo surface assoicated with them. This change provides a logically 1x1 cairo surface (respecting scale) for the root window. https://bugzilla.gnome.org/show_bug.cgi?id=704554