mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-28 16:27:17 +00:00
[client] x11: handle window deletion properly
This commit is contained in:
parent
5ac53362a3
commit
17d423db06
@ -76,6 +76,7 @@ struct X11DSState
|
|||||||
Atom aNetWMStateFullscreen;
|
Atom aNetWMStateFullscreen;
|
||||||
Atom aNetWMWindowType;
|
Atom aNetWMWindowType;
|
||||||
Atom aNetWMWindowTypeNormal;
|
Atom aNetWMWindowTypeNormal;
|
||||||
|
Atom aWMDeleteWindow;
|
||||||
|
|
||||||
// clipboard members
|
// clipboard members
|
||||||
Atom aSelection;
|
Atom aSelection;
|
||||||
@ -209,6 +210,10 @@ static bool x11Init(const LG_DSInitParams params)
|
|||||||
XInternAtom(x11.display, "_NET_WM_WINDOW_TYPE", True);
|
XInternAtom(x11.display, "_NET_WM_WINDOW_TYPE", True);
|
||||||
x11.aNetWMWindowTypeNormal =
|
x11.aNetWMWindowTypeNormal =
|
||||||
XInternAtom(x11.display, "_NET_WM_WINDOW_TYPE_NORMAL", True);
|
XInternAtom(x11.display, "_NET_WM_WINDOW_TYPE_NORMAL", True);
|
||||||
|
x11.aWMDeleteWindow =
|
||||||
|
XInternAtom(x11.display, "WM_DELETE_WINDOW", True);
|
||||||
|
|
||||||
|
XSetWMProtocols(x11.display, x11.window, &x11.aWMDeleteWindow, 1);
|
||||||
|
|
||||||
XChangeProperty(
|
XChangeProperty(
|
||||||
x11.display,
|
x11.display,
|
||||||
@ -510,13 +515,9 @@ static int x11EventThread(void * unused)
|
|||||||
|
|
||||||
switch(xe.type)
|
switch(xe.type)
|
||||||
{
|
{
|
||||||
case DestroyNotify:
|
case ClientMessage:
|
||||||
if (xe.xdestroywindow.display == x11.display &&
|
if (xe.xclient.data.l[0] == x11.aWMDeleteWindow)
|
||||||
xe.xdestroywindow.window == x11.window)
|
|
||||||
{
|
|
||||||
x11.window = 0;
|
|
||||||
app_handleCloseEvent();
|
app_handleCloseEvent();
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ConfigureNotify:
|
case ConfigureNotify:
|
||||||
|
Loading…
Reference in New Issue
Block a user