Merge pull request #10409 from MatthewAllDev/master

Fix: Prevent RemoteAPP window minimization on desktop switch in Gnome
This commit is contained in:
akallabeth 2024-07-23 15:49:05 +02:00 committed by GitHub
commit 5764b8d49e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 1 deletions

View File

@ -23,6 +23,8 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <string.h>
#include <winpr/assert.h>
#include <freerdp/log.h>
@ -35,6 +37,7 @@
#include "xf_input.h"
#include "xf_gfx.h"
#include "xf_graphics.h"
#include "xf_utils.h"
#include "xf_event.h"
@ -982,7 +985,7 @@ static BOOL xf_event_PropertyNotify(xfContext* xfc, const XPropertyEvent* event,
if (status)
{
/* If the window is in the iconic state */
if (((UINT32)*prop == 3))
if (((UINT32)*prop == 3) && !IsGnome())
{
minimized = TRUE;
if (appWindow)

View File

@ -18,7 +18,9 @@
* limitations under the License.
*/
#include <string.h>
#include <winpr/assert.h>
#include <winpr/wtypes.h>
#include "xf_utils.h"
@ -150,3 +152,9 @@ int LogDynAndXGetWindowProperty_ex(wLog* log, const char* file, const char* fkt,
actual_type_return, actual_format_return, nitems_return,
bytes_after_return, prop_return);
}
BOOL IsGnome(void)
{
char* env = getenv("DESKTOP_SESSION");
return (env != NULL && strcmp(env, "gnome") == 0);
}

View File

@ -20,6 +20,7 @@
#pragma once
#include <winpr/wlog.h>
#include <winpr/wtypes.h>
#include <X11/Xlib.h>
@ -89,3 +90,5 @@ int LogTagAndXConvertSelection_ex(const char* tag, const char* file, const char*
int LogDynAndXConvertSelection_ex(wLog* log, const char* file, const char* fkt, size_t line,
Display* display, Atom selection, Atom target, Atom property,
Window requestor, Time time);
BOOL IsGnome(void);