Fix fullscreen in the X11 hooks of eglfs

It did not work since the request was made after mapping.

Add also basic screen size detection and make fullscreen the default. No more
windowed nonsense which is not very useful anyhow due to the trouble with
input (multiple mouse cursors etc.).

Instead, launch always in fullscreen on X. This gives a unified experience when
running with -platform eglfs, regardless of using KMS on a console or the X11
hooks under X or just fbdev. It also eliminates the annoyance of not having
vsync for non-fullscreen X windows on boards like the Jetson TK1 (where fbdev is
not an option).

[ChangeLog][QtGui] eglfs is now using fullscreen mode also when running on X11.

Change-Id: I3b05728c2c37d6e0abd53cf2843670a1262243bd
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
bb10
Laszlo Agocs 2014-12-05 19:28:47 +01:00
parent 2203d9d93e
commit 174f54b5a6
1 changed files with 8 additions and 10 deletions

View File

@ -219,8 +219,9 @@ QSize QEglFSX11Integration::screenSize() const
if (env.length() == 2) {
m_screenSize = QSize(env.at(0).toInt(), env.at(1).toInt());
} else {
m_screenSize = QSize(640, 480);
qWarning("EGLFS_X11_SIZE not set, falling back to 640x480");
XWindowAttributes a;
if (XGetWindowAttributes(DISPLAY, DefaultRootWindow(DISPLAY), &a))
m_screenSize = QSize(a.width, a.height);
}
}
return m_screenSize;
@ -241,8 +242,6 @@ EGLNativeWindowType QEglFSX11Integration::createNativeWindow(QPlatformWindow *pl
XCB_WINDOW_CLASS_INPUT_OUTPUT, it.data->root_visual,
0, 0);
xcb_map_window(m_connection, m_window);
xcb_intern_atom_cookie_t cookies[Atoms::N_ATOMS];
static const char *atomNames[Atoms::N_ATOMS] = {
"_NET_WM_NAME",
@ -268,12 +267,11 @@ EGLNativeWindowType QEglFSX11Integration::createNativeWindow(QPlatformWindow *pl
xcb_change_property(m_connection, XCB_PROP_MODE_REPLACE, m_window,
m_atoms[Atoms::WM_PROTOCOLS], XCB_ATOM_ATOM, 32, 1, &m_atoms[Atoms::WM_DELETE_WINDOW]);
if (qEnvironmentVariableIntValue("EGLFS_X11_FULLSCREEN")) {
// Go fullscreen. The QScreen and QWindow size is controlled by EGLFS_X11_SIZE regardless,
// this is just the native window.
xcb_change_property(m_connection, XCB_PROP_MODE_REPLACE, m_window,
m_atoms[Atoms::_NET_WM_STATE], XCB_ATOM_ATOM, 32, 1, &m_atoms[Atoms::_NET_WM_STATE_FULLSCREEN]);
}
// Go fullscreen.
xcb_change_property(m_connection, XCB_PROP_MODE_REPLACE, m_window,
m_atoms[Atoms::_NET_WM_STATE], XCB_ATOM_ATOM, 32, 1, &m_atoms[Atoms::_NET_WM_STATE_FULLSCREEN]);
xcb_map_window(m_connection, m_window);
xcb_flush(m_connection);