[X2Go-Commits] [x2gokdrive] 01/01: Handling WM_DELETE_WINDOW

git-admin at x2go.org git-admin at x2go.org
Wed Feb 9 17:39:28 CET 2022


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch feature/rootless-mode
in repository x2gokdrive.

commit 6f1ffc45d99e1bb6c0b5a2c5817495010ff7783b
Author: Oleksandr Shneyder <o.shneyder at phoca-gmbh.de>
Date:   Wed Feb 9 10:39:13 2022 -0600

    Handling WM_DELETE_WINDOW
---
 x2gokdriveremote.c | 38 +++++++++++++++++++++++++++++++++-----
 x2gokdriveremote.h |  3 ++-
 2 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/x2gokdriveremote.c b/x2gokdriveremote.c
index 95e7d3a..59d18db 100644
--- a/x2gokdriveremote.c
+++ b/x2gokdriveremote.c
@@ -2586,6 +2586,11 @@ clientReadNotify(int fd, int ready, void *data)
                     client_win_change(buff);
                     break;
                 }
+                case WINCLOSE:
+                {
+                    client_win_close(buff);
+                    break;
+                }
                 default:
                 {
                     EPHYR_DBG("UNSUPPORTED EVENT: %d",event_type);
@@ -2647,6 +2652,29 @@ ReflectStackChange(WindowPtr pWin, WindowPtr pSib, VTKind kind)
         WindowsRestructured();
 }
 
+void client_win_close(char* buff)
+{
+    WindowPtr pWin;
+    uint32_t winId=*((uint32_t*)(buff+4));
+    xEvent e;
+//     EPHYR_DBG("Client request win close: 0x%x",winId);
+    pWin=remote_find_window_on_screen_by_id(winId, remoteVars.ephyrScreen->pScreen->root);
+    if(!pWin)
+    {
+        EPHYR_DBG("Window with ID 0x%X not found on current screen",winId);
+        return;
+    }
+    e.u.u.type = ClientMessage;
+    e.u.u.detail = 32;
+    e.u.clientMessage.window = winId;
+    e.u.clientMessage.u.l.type = MakeAtom("WM_PROTOCOLS",strlen("WM_PROTOCOLS"),FALSE);
+    e.u.clientMessage.u.l.longs0 = MakeAtom("WM_DELETE_WINDOW",strlen("WM_DELETE_WINDOW"),FALSE);
+    e.u.clientMessage.u.l.longs1 = 0;
+    e.u.clientMessage.u.l.longs2 = 0;
+    e.u.clientMessage.u.l.longs3 = 0;
+    e.u.clientMessage.u.l.longs4 = 0;
+    DeliverEvents(pWin, &e, 1, NullWindow);
+}
 
 
 void client_win_change(char* buff)
@@ -3831,7 +3859,7 @@ void remote_check_window(WindowPtr win)
     uint32_t max_icon_w=0, max_icon_h=0;
     unsigned char *icon_data;
     uint32_t focusWinId=0;
-    ExWMHints* wmhints;
+//     ExWMHints* wmhints;
     ExSizeHints* sizehints;
     FocusClassPtr focus = inputInfo.keyboard->focus;
     WindowPtr parPtr;
@@ -3986,7 +4014,7 @@ void remote_check_window(WindowPtr win)
                     }
                 }
             }
-            if(prop->propertyName==MakeAtom("WM_NAME", strlen("WM_NAME"),FALSE) && prop->data)
+/*            if(prop->propertyName==MakeAtom("WM_NAME", strlen("WM_NAME"),FALSE) && prop->data)
             {
 //                 EPHYR_DBG("-- Name: %s",(char*)prop->data);
             }
@@ -4000,8 +4028,8 @@ void remote_check_window(WindowPtr win)
             }
             if(prop->propertyName==MakeAtom("WM_PROTOCOLS", strlen("WM_PROTOCOLS"),FALSE) && prop->data)
             {
-//                 ATOM* at=prop->data;
-//                 EPHYR_DBG("-- WM_PROTOCOLS: %s",NameForAtom( at[0] ));
+                 ATOM* at=prop->data;
+                 EPHYR_DBG("-- WM_PROTOCOLS: %s",NameForAtom( at[0] ));
             }
             if(prop->propertyName==MakeAtom("WM_HINTS", strlen("WM_HINTS"),FALSE))
             {
@@ -4015,7 +4043,7 @@ void remote_check_window(WindowPtr win)
                 {
                     EPHYR_DBG("     State: %d",wmhints->initial_state);
                 }
-            }
+            }*/
             if(prop->propertyName==MakeAtom("WM_NORMAL_HINTS", strlen("WM_NORMAL_HINTS"),FALSE))
             {
                 EPHYR_DBG("--SIZE HINTS:");
diff --git a/x2gokdriveremote.h b/x2gokdriveremote.h
index 5d74c23..6e07a67 100644
--- a/x2gokdriveremote.h
+++ b/x2gokdriveremote.h
@@ -163,7 +163,7 @@ enum WinType{WINDOW_TYPE_DESKTOP, WINDOW_TYPE_DOCK, WINDOW_TYPE_TOOLBAR, WINDOW_
 #define KEEPALIVE 12
 #define CACHEREBUILD 13
 #define WINCHANGE 14
-
+#define WINCLOSE 15
 
 #define EVLENGTH 41
 
@@ -558,6 +558,7 @@ WindowPtr remote_find_window_on_screen_by_id(uint32_t winId, WindowPtr root);
 void remote_process_window_updates(void);
 void send_reinit_notification(void);
 void client_win_change(char* buff);
+void client_win_close(char* buff);
 void remote_check_rootless_windows_for_updates(KdScreenInfo *screen);
 
 #endif /* X2GOKDRIVE_REMOTE_H */

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gokdrive.git


More information about the x2go-commits mailing list