![]() Registered Member ![]()
|
I created a borderless toggle extension for GameMaker Studio, and a requirement of this software is that is can only make use of exported functions with double's and pointers for the arguments and return values, just to give some background on why I did that, beforehand. I am using similar code for another game engine known as ENIGMA. This code can be used on virtually any X11 application simply by either in the form of a dynamic or static library, as well as just including the header.
I noticed KDE responds to the code I am using to measure the title bar and window border than most other desktop environments I've tried - this includes KDE (ofc), GNOME, XFCE, and LXDE. GNOME, XFCE, and LXDE all responded the same to the code. The client area of the application positioned to the same coordinates specified by the clientx and clienty arguments, however, in KDE the window moved to the wrong positon with the same code used. So then, I had to detect whether the current Desktop Environment was running KWin, which is KDE's native Window Manager, if I remember correctly. I'm not sure if it is the the desktop environment at fault, or the Window Manager that is responsible for this oddity and inconsistency among the other Linux distributions I've tried, but I assume it is the WM, as my best guess. Long story short, I need to know for certain which is causing the issue, the DE, or the WM, and then, I need to be able to check that accurately in code, because right now I'm just checking for the environment variable XDG_CURRENT_DESKTOP and if it has a value of KDE then use KDE specific code, otherwise use GNOME/XFCE/LXDE code. As you can see, I managed to eventually get it working in KDE as well as non-KDE DE's, in the GIF's below, but this is only done by sheer luck of the XDG_CURRENT_DESKTOP environment variable both existing on KDE neon, as well as equaling the exact value of KDE. That said, it doesn't work anymore if I delete or change the value of XDG_CURRENT_DESKTOP, and it will also not work if I happen to not be using KDE as my desktop environment, but am using the KWin Window Manager. Please help. ShowBorder.h (C++ Header):
ShowBorder.cpp (C++ Source):
GameMaker Studio 2 Usage:
GameMaker Studo 2 Result: https://i.imgur.com/CTV3A6b.gif (KDE neon 5.16.4) https://i.imgur.com/rwpD476.gif (Lubuntu 18.04.2 LTS) https://i.imgur.com/eB4OUfk.gif (Xubuntu 18.04.2 LTS) https://i.imgur.com/REAFb9B.gif (Ubuntu 18.04.2 LTS) Needless to say, it also worked in Kubuntu 18.04.2 LTS, but I don't have screenshots for that. Thanks, Samuel
Last edited by samuelvenable on Thu Aug 08, 2019 9:05 pm, edited 5 times in total.
|
![]() Registered Member ![]()
|
There are multiple ways to check if KWin is running.
* Use D-Bus. KWin registers the 'org.kde.KWin' namespace there. * Check https://cgit.kde.org/kwin.git/tree/atoms.cpp for X11 Atoms KWin uses. But I suggest to report your issue to bugs.kde.org. KWin developers might check if KWin is wrong or your code is wrong. |
![]() Registered Member ![]()
|
That's perfect! Thank you! I will update my code in the OP with the changes I've made. It works great!
|
Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell