简体   繁体   English

Qt-将窗口提升到Linux DE上的当前桌面/工作区

[英]Qt - raise window to current desktop/workspace on Linux DE

Preconditions: My Qt program (MainWindow) works on FIRST Linux desktop, and I work on SECOND . 前提:我的Qt程序(MainWindow)在FIRST Linux桌面上工作,而我在SECOND上工作。

Program invokes such piece of code: 程序调用以下代码:

mainWindow->raise();

What happens? 怎么了? My Desktop Environment switches to the FIRST desktop and shows main window on my app. 我的桌面环境切换到FIRST桌面,并在我的应用程序上显示主窗口。

What I want to happen? 我想发生什么? Main window of my app is moved to the current ( SECOND ) desktop and shows here. 我的应用程序的主窗口已移至当前( SECOND )桌面,并显示在此处。

Is it possible with Qt and how? Qt有可能吗?如何?

Qt not support full Linux DE/WM environment. Qt不支持完整的Linux DE / WM环境。 Virtual desktop is like not real virtual desktop. 虚拟桌面就像不是真正的虚拟桌面。

This is complex question. 这是一个复杂的问题。 I'll try explain (bad english). 我会尝试解释(英语不好)。

Desktops and workspaces on Linux X Window System: https://www.circuitousroot.com/artifice/programming/useful/fvwm/viewports/index.html Linux X Window系统上的桌面和工作区: https : //www.circuitousroot.com/artifice/programming/useful/fvwm/viewports/index.html

Qt use xcb: https://xcb.freedesktop.org/ Here we have xcb connection: http://doc.qt.io/qt-5/qx11info.html#connection This is hard way without other libraries: xcb, ICCCM, EWMH only... I have this issue for my application, but later. Qt使用xcb: https ://xcb.freedesktop.org/这里有xcb连接: http ://doc.qt.io/qt-5/qx11info.html#connection没有其他库,这是很难的方法:xcb,ICCCM ,仅限EWMH ...对于我的应用程序,我有这个问题,但是稍后。 I have only dirty tests on pure C, and it works. 我在纯C上只有肮脏的测试,并且可以正常工作。

You can try use (or look how to implement, I watched here) KWindowSystem: https://api.kde.org/frameworks/kwindowsystem/html/classKWindowSystem.html (which not have KDE dependencies!!!) but this class not have all functionality for all EWMH commands. 您可以尝试使用(或查看如何实现,我在这里观看了)KWindowSystem: https ://api.kde.org/frameworks/kwindowsystem/html/classKWindowSystem.html(不具有KDE依赖!!!),但此类具有所有EWMH命令的所有功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM