aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-12-19 03:58:36 (GMT)
committerfluxgen <fluxgen>2003-12-19 03:58:36 (GMT)
commitf3efaa8a6e54b9d765b7a113aa1102e8ede57b9c (patch)
tree8a0785265bd51dd45c0ce8143e1fa35d29a045e2
parent78c5d474f78edf93895f0028e41047dd80ce7641 (diff)
downloadfluxbox_pavel-f3efaa8a6e54b9d765b7a113aa1102e8ede57b9c.zip
fluxbox_pavel-f3efaa8a6e54b9d765b7a113aa1102e8ede57b9c.tar.bz2
update mouse and key screen before we enter FbTk EventManager
-rw-r--r--src/fluxbox.cc28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index d3fd613..c831713 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: fluxbox.cc,v 1.208 2003/12/19 00:35:08 fluxgen Exp $ 25// $Id: fluxbox.cc,v 1.209 2003/12/19 03:58:36 fluxgen Exp $
26 26
27#include "fluxbox.hh" 27#include "fluxbox.hh"
28 28
@@ -575,7 +575,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
575 // For dumping theme items 575 // For dumping theme items
576 // FbTk::ThemeManager::instance().listItems(); 576 // FbTk::ThemeManager::instance().listItems();
577 // 577 //
578 m_resourcemanager.dump(); 578 // m_resourcemanager.dump();
579} 579}
580 580
581 581
@@ -751,6 +751,19 @@ void Fluxbox::handleEvent(XEvent * const e) {
751 } 751 }
752 752
753 753
754 // update key/mouse screen before we enter other eventhandlers
755 if (e->type == KeyPress ||
756 e->type == KeyRelease) {
757 m_keyscreen = searchScreen(e->xkey.root);
758 } else if (e->type == ButtonPress ||
759 e->type == ButtonRelease ||
760 e->type == MotionNotify ) {
761 m_mousescreen = searchScreen(e->xbutton.root);
762 } else if (e->type == EnterNotify ||
763 e->type == LeaveNotify) {
764 m_mousescreen = searchScreen(e->xcrossing.root);
765 }
766
754 // try FbTk::EventHandler first 767 // try FbTk::EventHandler first
755 FbTk::EventManager::instance()->handleEvent(*e); 768 FbTk::EventManager::instance()->handleEvent(*e);
756 769
@@ -942,7 +955,6 @@ void Fluxbox::handleEvent(XEvent * const e) {
942} 955}
943 956
944void Fluxbox::handleButtonEvent(XButtonEvent &be) { 957void Fluxbox::handleButtonEvent(XButtonEvent &be) {
945 m_mousescreen = searchScreen(be.root);
946 958
947 switch (be.type) { 959 switch (be.type) {
948 case ButtonPress: { 960 case ButtonPress: {
@@ -1160,16 +1172,6 @@ void Fluxbox::handleClientMessage(XClientMessageEvent &ce) {
1160 Handles KeyRelease and KeyPress events 1172 Handles KeyRelease and KeyPress events
1161*/ 1173*/
1162void Fluxbox::handleKeyEvent(XKeyEvent &ke) { 1174void Fluxbox::handleKeyEvent(XKeyEvent &ke) {
1163 m_keyscreen = searchScreen(ke.window);
1164
1165 m_mousescreen = keyScreen();
1166 Window root, ignorew;
1167 int ignored;
1168 if (!XQueryPointer(FbTk::App::instance()->display(),
1169 ke.window, &root, &ignorew, &ignored, &ignored,
1170 &ignored, &ignored, (unsigned int *)&ignored))
1171 // pointer on different screen to ke.window
1172 m_mousescreen = searchScreen(root);
1173 1175
1174 if (keyScreen() == 0 || mouseScreen() == 0) 1176 if (keyScreen() == 0 || mouseScreen() == 0)
1175 return; 1177 return;