summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2014-12-05 19:28:47 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2014-12-09 16:58:07 +0100
commit174f54b5a628bed09cce42f2945c2ede1d7977f2 (patch)
tree202998b79ba72d1b700e2f067c7f2bcc75fec3e1 /src/plugins/platforms/eglfs
parent2203d9d93e24e00d6e9bc9bda0e65a0c7f9923cc (diff)
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>
Diffstat (limited to 'src/plugins/platforms/eglfs')
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp
index 0ce5e341bf..e41c007df9 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/qeglfsx11integration.cpp
@@ -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);