diff options
author | Thomas Lübking <thomas.luebking@gmail.com> | 2016-07-04 19:55:23 (GMT) |
---|---|---|
committer | Thomas Lübking <thomas.luebking@gmail.com> | 2016-08-27 07:36:19 (GMT) |
commit | 2c6647112667109b109e578ffd55ae8409c9e1af (patch) | |
tree | dea7cbb288f2eb286ff5cb7a3a5bd70e833572c6 /src/SystemTray.cc | |
parent | ecdaab5edf619d3cdc7bba9856d5f92068c28c83 (diff) | |
download | fluxbox-2c6647112667109b109e578ffd55ae8409c9e1af.zip fluxbox-2c6647112667109b109e578ffd55ae8409c9e1af.tar.bz2 |
Replay toolbar button events
NOTICE!!!! THIS IS HIGHLY EXPERIMENTAL!
The patch alters the button grab mode to GrabSync
in order to ReplayPointer the event.
THIS CAN FREEZE ANY INPUT TO FLUXBOX!!!
The toolbar (and other things?) grab buttons in order to
handle MouseN events for the entire bar, INCLUDING all child
windows.
This causes two problems:
1. The bar handles events which are not meant for fluxbox at all
(but the systray icons)
BUG: 940
2. The bar will intercept (and suck) *every* press, even if only
doubleclicks are desired
BUG: 949
The problem with this patch is that an oversight here has the potential
to completely freeze input event processing in fluxbox (ie. the process
needs to be killed from outside), SO IT NEEDS TESTING!
As much as possible.
Diffstat (limited to 'src/SystemTray.cc')
-rw-r--r-- | src/SystemTray.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/SystemTray.cc b/src/SystemTray.cc index e45669e..4fa9da3 100644 --- a/src/SystemTray.cc +++ b/src/SystemTray.cc | |||
@@ -77,6 +77,8 @@ void getScreenCoordinates(Window win, int x, int y, int &screen_x, int &screen_y | |||
77 | 77 | ||
78 | }; | 78 | }; |
79 | 79 | ||
80 | static SystemTray *s_theoneandonly = 0; | ||
81 | |||
80 | /// helper class for tray windows, so we dont call XDestroyWindow | 82 | /// helper class for tray windows, so we dont call XDestroyWindow |
81 | class SystemTray::TrayWindow : public FbTk::FbWindow { | 83 | class SystemTray::TrayWindow : public FbTk::FbWindow { |
82 | public: | 84 | public: |
@@ -220,6 +222,8 @@ SystemTray::SystemTray(const FbTk::FbWindow& parent, | |||
220 | // set owner | 222 | // set owner |
221 | XSetSelectionOwner(disp, tray_atom, m_selection_owner.window(), CurrentTime); | 223 | XSetSelectionOwner(disp, tray_atom, m_selection_owner.window(), CurrentTime); |
222 | 224 | ||
225 | s_theoneandonly = this; | ||
226 | |||
223 | m_handler.reset(new SystemTrayHandler(*this)); | 227 | m_handler.reset(new SystemTrayHandler(*this)); |
224 | 228 | ||
225 | m_handler.get()->setName(atom_name); | 229 | m_handler.get()->setName(atom_name); |
@@ -247,6 +251,8 @@ SystemTray::SystemTray(const FbTk::FbWindow& parent, | |||
247 | 251 | ||
248 | SystemTray::~SystemTray() { | 252 | SystemTray::~SystemTray() { |
249 | // remove us, else fluxbox might delete the memory too | 253 | // remove us, else fluxbox might delete the memory too |
254 | if (s_theoneandonly == this) | ||
255 | s_theoneandonly = 0; | ||
250 | Fluxbox* fluxbox = Fluxbox::instance(); | 256 | Fluxbox* fluxbox = Fluxbox::instance(); |
251 | fluxbox->removeAtomHandler(m_handler.get()); | 257 | fluxbox->removeAtomHandler(m_handler.get()); |
252 | Display *disp = fluxbox->display(); | 258 | Display *disp = fluxbox->display(); |
@@ -589,3 +595,10 @@ string SystemTray::getNetSystemTrayAtom(int screen_nr) { | |||
589 | 595 | ||
590 | return atom_name; | 596 | return atom_name; |
591 | } | 597 | } |
598 | |||
599 | bool SystemTray::doesControl(Window win) { | ||
600 | if (win == None || !s_theoneandonly) | ||
601 | return false; | ||
602 | return win == s_theoneandonly->window().window() || | ||
603 | s_theoneandonly->findClient(win) != s_theoneandonly->m_clients.end(); | ||
604 | } | ||