summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/BaseDisplay.hh13
-rw-r--r--src/Window.cc29
-rw-r--r--src/fluxbox.cc5
3 files changed, 17 insertions, 30 deletions
diff --git a/src/BaseDisplay.hh b/src/BaseDisplay.hh
index 0a35dd1..09af9c5 100644
--- a/src/BaseDisplay.hh
+++ b/src/BaseDisplay.hh
@@ -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: BaseDisplay.hh,v 1.27 2002/08/30 12:58:08 fluxgen Exp $ 25// $Id: BaseDisplay.hh,v 1.28 2002/08/30 13:09:24 fluxgen Exp $
26 26
27#ifndef BASEDISPLAY_HH 27#ifndef BASEDISPLAY_HH
28#define BASEDISPLAY_HH 28#define BASEDISPLAY_HH
@@ -109,17 +109,6 @@ public:
109 void ungrab(); 109 void ungrab();
110 void eventLoop(); 110 void eventLoop();
111 111
112 class GrabGuard:private NotCopyable
113 {
114 public:
115 GrabGuard(BaseDisplay &bd):m_bd(bd) { }
116 ~GrabGuard() { m_bd.ungrab(); }
117 inline void grab() { m_bd.grab(); }
118 inline void ungrab() { m_bd.ungrab(); }
119 private:
120 BaseDisplay &m_bd;
121 };
122
123private: 112private:
124 113
125 struct shape { 114 struct shape {
diff --git a/src/Window.cc b/src/Window.cc
index 1704937..3648333 100644
--- a/src/Window.cc
+++ b/src/Window.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: Window.cc,v 1.71 2002/08/28 19:47:27 fluxgen Exp $ 25// $Id: Window.cc,v 1.72 2002/08/30 13:08:35 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -86,7 +86,6 @@ tab(0)
86 86
87 Fluxbox *fluxbox = Fluxbox::instance(); 87 Fluxbox *fluxbox = Fluxbox::instance();
88 display = fluxbox->getXDisplay(); 88 display = fluxbox->getXDisplay();
89 BaseDisplay::GrabGuard gg(*fluxbox);
90 89
91 blackbox_attrib.workspace = workspace_number = window_number = -1; 90 blackbox_attrib.workspace = workspace_number = window_number = -1;
92 91
@@ -153,6 +152,7 @@ tab(0)
153 XWindowAttributes wattrib; 152 XWindowAttributes wattrib;
154 if ((! XGetWindowAttributes(display, client.window, &wattrib)) || 153 if ((! XGetWindowAttributes(display, client.window, &wattrib)) ||
155 (! wattrib.screen) || wattrib.override_redirect) { 154 (! wattrib.screen) || wattrib.override_redirect) {
155 fluxbox->ungrab();
156 return; 156 return;
157 } 157 }
158 158
@@ -161,8 +161,10 @@ tab(0)
161 else 161 else
162 screen = fluxbox->searchScreen(RootWindowOfScreen(wattrib.screen)); 162 screen = fluxbox->searchScreen(RootWindowOfScreen(wattrib.screen));
163 163
164 if (!screen) 164 if (!screen) {
165 fluxbox->ungrab();
165 return; 166 return;
167 }
166 168
167 image_ctrl = screen->getImageControl(); 169 image_ctrl = screen->getImageControl();
168 170
@@ -190,6 +192,7 @@ tab(0)
190 192
191 if (client.initial_state == WithdrawnState) { 193 if (client.initial_state == WithdrawnState) {
192 screen->getSlit()->addClient(client.window); 194 screen->getSlit()->addClient(client.window);
195 fluxbox->ungrab();
193 return; 196 return;
194 } 197 }
195#endif // SLIT 198#endif // SLIT
@@ -329,6 +332,7 @@ tab(0)
329 fprintf(stderr, "%s(%d): FluxboxWindow(this=%p)\n", __FILE__, __LINE__, this); 332 fprintf(stderr, "%s(%d): FluxboxWindow(this=%p)\n", __FILE__, __LINE__, this);
330#endif // DEBUG 333#endif // DEBUG
331 334
335 fluxbox->ungrab();
332} 336}
333 337
334 338
@@ -1776,22 +1780,24 @@ bool FluxboxWindow::setInputFocus() {
1776 } 1780 }
1777 1781
1778 Fluxbox *fluxbox = Fluxbox::instance(); 1782 Fluxbox *fluxbox = Fluxbox::instance();
1779 BaseDisplay::GrabGuard gg(*fluxbox);
1780 fluxbox->grab(); 1783 fluxbox->grab();
1781 if (! validateClient()) 1784 if (! validateClient())
1782 return false; 1785 return false;
1783 1786
1784 bool ret = false; 1787 bool ret = false;
1785 1788
1786 if (client.transient && modal) 1789 if (client.transient && modal) {
1790 fluxbox->ungrab();
1787 return client.transient->setInputFocus(); 1791 return client.transient->setInputFocus();
1788 else { 1792 } else {
1789 if (! focused) { 1793 if (! focused) {
1790 if (focus_mode == F_LOCALLYACTIVE || focus_mode == F_PASSIVE) { 1794 if (focus_mode == F_LOCALLYACTIVE || focus_mode == F_PASSIVE) {
1791 XSetInputFocus(display, client.window, 1795 XSetInputFocus(display, client.window,
1792 RevertToPointerRoot, CurrentTime); 1796 RevertToPointerRoot, CurrentTime);
1793 } else 1797 } else {
1798 fluxbox->ungrab();
1794 return false; 1799 return false;
1800 }
1795 1801
1796 fluxbox->setFocusedWindow(this); 1802 fluxbox->setFocusedWindow(this);
1797 1803
@@ -2410,7 +2416,6 @@ void FluxboxWindow::setFocusFlag(bool focus) {
2410 2416
2411void FluxboxWindow::installColormap(bool install) { 2417void FluxboxWindow::installColormap(bool install) {
2412 Fluxbox *fluxbox = Fluxbox::instance(); 2418 Fluxbox *fluxbox = Fluxbox::instance();
2413 BaseDisplay::GrabGuard gg(*fluxbox);
2414 fluxbox->grab(); 2419 fluxbox->grab();
2415 if (! validateClient()) return; 2420 if (! validateClient()) return;
2416 2421
@@ -2731,7 +2736,6 @@ void FluxboxWindow::mapRequestEvent(XMapRequestEvent *re) {
2731 client.window); 2736 client.window);
2732#endif // DEBUG 2737#endif // DEBUG
2733 Fluxbox *fluxbox = Fluxbox::instance(); 2738 Fluxbox *fluxbox = Fluxbox::instance();
2734 BaseDisplay::GrabGuard gg(*fluxbox);
2735 fluxbox->grab(); 2739 fluxbox->grab();
2736 if (! validateClient()) 2740 if (! validateClient())
2737 return; 2741 return;
@@ -2806,7 +2810,6 @@ void FluxboxWindow::mapNotifyEvent(XMapEvent *ne) {
2806 2810
2807 if ((ne->window == client.window) && (! ne->override_redirect) && (visible)) { 2811 if ((ne->window == client.window) && (! ne->override_redirect) && (visible)) {
2808 Fluxbox *fluxbox = Fluxbox::instance(); 2812 Fluxbox *fluxbox = Fluxbox::instance();
2809 BaseDisplay::GrabGuard gg(*fluxbox);
2810 fluxbox->grab(); 2813 fluxbox->grab();
2811 if (! validateClient()) 2814 if (! validateClient())
2812 return; 2815 return;
@@ -2997,7 +3000,6 @@ void FluxboxWindow::exposeEvent(XExposeEvent *ee) {
2997void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent *cr) { 3000void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent *cr) {
2998 if (cr->window == client.window) { 3001 if (cr->window == client.window) {
2999 Fluxbox *fluxbox = Fluxbox::instance(); 3002 Fluxbox *fluxbox = Fluxbox::instance();
3000 BaseDisplay::GrabGuard gg(*fluxbox);
3001 fluxbox->grab(); 3003 fluxbox->grab();
3002 if (! validateClient()) 3004 if (! validateClient())
3003 return; 3005 return;
@@ -3061,7 +3063,6 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent *cr) {
3061 3063
3062void FluxboxWindow::buttonPressEvent(XButtonEvent *be) { 3064void FluxboxWindow::buttonPressEvent(XButtonEvent *be) {
3063 Fluxbox *fluxbox = Fluxbox::instance(); 3065 Fluxbox *fluxbox = Fluxbox::instance();
3064 BaseDisplay::GrabGuard gg(*fluxbox);
3065 fluxbox->grab(); 3066 fluxbox->grab();
3066 3067
3067 if (! validateClient()) 3068 if (! validateClient())
@@ -3182,7 +3183,6 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent *be) {
3182 3183
3183void FluxboxWindow::buttonReleaseEvent(XButtonEvent *re) { 3184void FluxboxWindow::buttonReleaseEvent(XButtonEvent *re) {
3184 Fluxbox *fluxbox = Fluxbox::instance(); 3185 Fluxbox *fluxbox = Fluxbox::instance();
3185 BaseDisplay::GrabGuard gg(*fluxbox);
3186 fluxbox->grab(); 3186 fluxbox->grab();
3187 3187
3188 if (! validateClient()) 3188 if (! validateClient())
@@ -3310,7 +3310,7 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent *me) {
3310 3310
3311 if (screen->doShowWindowPos()) 3311 if (screen->doShowWindowPos())
3312 screen->showPosition(dx, dy); 3312 screen->showPosition(dx, dy);
3313 } 3313 }
3314 } else if (functions.resize && 3314 } else if (functions.resize &&
3315 (((me->state & Button1Mask) && (me->window == frame.right_grip || 3315 (((me->state & Button1Mask) && (me->window == frame.right_grip ||
3316 me->window == frame.left_grip)) || 3316 me->window == frame.left_grip)) ||
@@ -3358,7 +3358,6 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent *me) {
3358#ifdef SHAPE 3358#ifdef SHAPE
3359void FluxboxWindow::shapeEvent(XShapeEvent *) { 3359void FluxboxWindow::shapeEvent(XShapeEvent *) {
3360 Fluxbox *fluxbox = Fluxbox::instance(); 3360 Fluxbox *fluxbox = Fluxbox::instance();
3361 BaseDisplay::GrabGuard gg(*fluxbox);
3362 3361
3363 if (fluxbox->hasShapeExtensions()) { 3362 if (fluxbox->hasShapeExtensions()) {
3364 if (frame.shaped) { 3363 if (frame.shaped) {
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 8c7fb9b..cc2e199 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.71 2002/08/18 11:01:52 fluxgen Exp $ 25// $Id: fluxbox.cc,v 1.72 2002/08/30 13:11:47 fluxgen Exp $
26 26
27 27
28#include "fluxbox.hh" 28#include "fluxbox.hh"
@@ -339,8 +339,7 @@ key(0)
339 339
340 //singleton pointer 340 //singleton pointer
341 singleton = this; 341 singleton = this;
342 BaseDisplay::GrabGuard gg(*this); 342 grab();
343 gg.grab();
344 343
345 setupConfigFiles(); 344 setupConfigFiles();
346 345