summaryrefslogtreecommitdiffstats
path: root/kdesktop/lock/main.cc
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-07-31 11:11:09 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-07-31 11:11:09 -0500
commitd0d37ed228915f97c589c92ea7ea5915965a5a47 (patch)
treeba118f0107641a4d4657f8d030da7950d76bc8f8 /kdesktop/lock/main.cc
parent93e690c7ea6d0076181e4b5888d301543b64307c (diff)
downloadtdebase-d0d37ed228915f97c589c92ea7ea5915965a5a47.tar.gz
tdebase-d0d37ed228915f97c589c92ea7ea5915965a5a47.zip
Fix Xorg memory leak on moving windows
This resolves Bug 2078 Thanks to Jan Janeček for significant help in tracking this down!
Diffstat (limited to 'kdesktop/lock/main.cc')
-rw-r--r--kdesktop/lock/main.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/kdesktop/lock/main.cc b/kdesktop/lock/main.cc
index 2a8a6657d..d5f037f56 100644
--- a/kdesktop/lock/main.cc
+++ b/kdesktop/lock/main.cc
@@ -422,8 +422,19 @@ int main( int argc, char **argv )
return 12;
}
+ // Get root window attributes
+ XWindowAttributes rootAttr;
+ XGetWindowAttributes(tqt_xdisplay(), RootWindow(tqt_xdisplay(), tqt_xscreen()), &rootAttr);
+
+ // Disable reception of all X11 events on the root window
+ XSelectInput( tqt_xdisplay(), tqt_xrootwin(), 0 );
+ app.processEvents();
+
// wait for SIGUSR1, SIGUSR2, SIGWINCH, SIGTTIN, or SIGTTOU
sigsuspend(&new_mask);
+
+ // Reenable reception of X11 events on the root window
+ XSelectInput( tqt_xdisplay(), tqt_xrootwin(), rootAttr.your_event_mask );
}
}