removed grabguard

This commit is contained in:
fluxgen 2002-08-30 13:11:47 +00:00
parent 65a124a83c
commit 2b168a584f
3 changed files with 17 additions and 30 deletions

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: BaseDisplay.hh,v 1.27 2002/08/30 12:58:08 fluxgen Exp $ // $Id: BaseDisplay.hh,v 1.28 2002/08/30 13:09:24 fluxgen Exp $
#ifndef BASEDISPLAY_HH #ifndef BASEDISPLAY_HH
#define BASEDISPLAY_HH #define BASEDISPLAY_HH
@ -109,17 +109,6 @@ public:
void ungrab(); void ungrab();
void eventLoop(); void eventLoop();
class GrabGuard:private NotCopyable
{
public:
GrabGuard(BaseDisplay &bd):m_bd(bd) { }
~GrabGuard() { m_bd.ungrab(); }
inline void grab() { m_bd.grab(); }
inline void ungrab() { m_bd.ungrab(); }
private:
BaseDisplay &m_bd;
};
private: private:
struct shape { struct shape {

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: Window.cc,v 1.71 2002/08/28 19:47:27 fluxgen Exp $ // $Id: Window.cc,v 1.72 2002/08/30 13:08:35 fluxgen Exp $
#include "Window.hh" #include "Window.hh"
@ -86,7 +86,6 @@ tab(0)
Fluxbox *fluxbox = Fluxbox::instance(); Fluxbox *fluxbox = Fluxbox::instance();
display = fluxbox->getXDisplay(); display = fluxbox->getXDisplay();
BaseDisplay::GrabGuard gg(*fluxbox);
blackbox_attrib.workspace = workspace_number = window_number = -1; blackbox_attrib.workspace = workspace_number = window_number = -1;
@ -153,6 +152,7 @@ tab(0)
XWindowAttributes wattrib; XWindowAttributes wattrib;
if ((! XGetWindowAttributes(display, client.window, &wattrib)) || if ((! XGetWindowAttributes(display, client.window, &wattrib)) ||
(! wattrib.screen) || wattrib.override_redirect) { (! wattrib.screen) || wattrib.override_redirect) {
fluxbox->ungrab();
return; return;
} }
@ -161,8 +161,10 @@ tab(0)
else else
screen = fluxbox->searchScreen(RootWindowOfScreen(wattrib.screen)); screen = fluxbox->searchScreen(RootWindowOfScreen(wattrib.screen));
if (!screen) if (!screen) {
fluxbox->ungrab();
return; return;
}
image_ctrl = screen->getImageControl(); image_ctrl = screen->getImageControl();
@ -190,6 +192,7 @@ tab(0)
if (client.initial_state == WithdrawnState) { if (client.initial_state == WithdrawnState) {
screen->getSlit()->addClient(client.window); screen->getSlit()->addClient(client.window);
fluxbox->ungrab();
return; return;
} }
#endif // SLIT #endif // SLIT
@ -329,6 +332,7 @@ tab(0)
fprintf(stderr, "%s(%d): FluxboxWindow(this=%p)\n", __FILE__, __LINE__, this); fprintf(stderr, "%s(%d): FluxboxWindow(this=%p)\n", __FILE__, __LINE__, this);
#endif // DEBUG #endif // DEBUG
fluxbox->ungrab();
} }
@ -1776,22 +1780,24 @@ bool FluxboxWindow::setInputFocus() {
} }
Fluxbox *fluxbox = Fluxbox::instance(); Fluxbox *fluxbox = Fluxbox::instance();
BaseDisplay::GrabGuard gg(*fluxbox);
fluxbox->grab(); fluxbox->grab();
if (! validateClient()) if (! validateClient())
return false; return false;
bool ret = false; bool ret = false;
if (client.transient && modal) if (client.transient && modal) {
fluxbox->ungrab();
return client.transient->setInputFocus(); return client.transient->setInputFocus();
else { } else {
if (! focused) { if (! focused) {
if (focus_mode == F_LOCALLYACTIVE || focus_mode == F_PASSIVE) { if (focus_mode == F_LOCALLYACTIVE || focus_mode == F_PASSIVE) {
XSetInputFocus(display, client.window, XSetInputFocus(display, client.window,
RevertToPointerRoot, CurrentTime); RevertToPointerRoot, CurrentTime);
} else } else {
fluxbox->ungrab();
return false; return false;
}
fluxbox->setFocusedWindow(this); fluxbox->setFocusedWindow(this);
@ -2410,7 +2416,6 @@ void FluxboxWindow::setFocusFlag(bool focus) {
void FluxboxWindow::installColormap(bool install) { void FluxboxWindow::installColormap(bool install) {
Fluxbox *fluxbox = Fluxbox::instance(); Fluxbox *fluxbox = Fluxbox::instance();
BaseDisplay::GrabGuard gg(*fluxbox);
fluxbox->grab(); fluxbox->grab();
if (! validateClient()) return; if (! validateClient()) return;
@ -2731,7 +2736,6 @@ void FluxboxWindow::mapRequestEvent(XMapRequestEvent *re) {
client.window); client.window);
#endif // DEBUG #endif // DEBUG
Fluxbox *fluxbox = Fluxbox::instance(); Fluxbox *fluxbox = Fluxbox::instance();
BaseDisplay::GrabGuard gg(*fluxbox);
fluxbox->grab(); fluxbox->grab();
if (! validateClient()) if (! validateClient())
return; return;
@ -2806,7 +2810,6 @@ void FluxboxWindow::mapNotifyEvent(XMapEvent *ne) {
if ((ne->window == client.window) && (! ne->override_redirect) && (visible)) { if ((ne->window == client.window) && (! ne->override_redirect) && (visible)) {
Fluxbox *fluxbox = Fluxbox::instance(); Fluxbox *fluxbox = Fluxbox::instance();
BaseDisplay::GrabGuard gg(*fluxbox);
fluxbox->grab(); fluxbox->grab();
if (! validateClient()) if (! validateClient())
return; return;
@ -2997,7 +3000,6 @@ void FluxboxWindow::exposeEvent(XExposeEvent *ee) {
void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent *cr) { void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent *cr) {
if (cr->window == client.window) { if (cr->window == client.window) {
Fluxbox *fluxbox = Fluxbox::instance(); Fluxbox *fluxbox = Fluxbox::instance();
BaseDisplay::GrabGuard gg(*fluxbox);
fluxbox->grab(); fluxbox->grab();
if (! validateClient()) if (! validateClient())
return; return;
@ -3061,7 +3063,6 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent *cr) {
void FluxboxWindow::buttonPressEvent(XButtonEvent *be) { void FluxboxWindow::buttonPressEvent(XButtonEvent *be) {
Fluxbox *fluxbox = Fluxbox::instance(); Fluxbox *fluxbox = Fluxbox::instance();
BaseDisplay::GrabGuard gg(*fluxbox);
fluxbox->grab(); fluxbox->grab();
if (! validateClient()) if (! validateClient())
@ -3182,7 +3183,6 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent *be) {
void FluxboxWindow::buttonReleaseEvent(XButtonEvent *re) { void FluxboxWindow::buttonReleaseEvent(XButtonEvent *re) {
Fluxbox *fluxbox = Fluxbox::instance(); Fluxbox *fluxbox = Fluxbox::instance();
BaseDisplay::GrabGuard gg(*fluxbox);
fluxbox->grab(); fluxbox->grab();
if (! validateClient()) if (! validateClient())
@ -3310,7 +3310,7 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent *me) {
if (screen->doShowWindowPos()) if (screen->doShowWindowPos())
screen->showPosition(dx, dy); screen->showPosition(dx, dy);
} }
} else if (functions.resize && } else if (functions.resize &&
(((me->state & Button1Mask) && (me->window == frame.right_grip || (((me->state & Button1Mask) && (me->window == frame.right_grip ||
me->window == frame.left_grip)) || me->window == frame.left_grip)) ||
@ -3358,7 +3358,6 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent *me) {
#ifdef SHAPE #ifdef SHAPE
void FluxboxWindow::shapeEvent(XShapeEvent *) { void FluxboxWindow::shapeEvent(XShapeEvent *) {
Fluxbox *fluxbox = Fluxbox::instance(); Fluxbox *fluxbox = Fluxbox::instance();
BaseDisplay::GrabGuard gg(*fluxbox);
if (fluxbox->hasShapeExtensions()) { if (fluxbox->hasShapeExtensions()) {
if (frame.shaped) { if (frame.shaped) {

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: fluxbox.cc,v 1.71 2002/08/18 11:01:52 fluxgen Exp $ // $Id: fluxbox.cc,v 1.72 2002/08/30 13:11:47 fluxgen Exp $
#include "fluxbox.hh" #include "fluxbox.hh"
@ -339,8 +339,7 @@ key(0)
//singleton pointer //singleton pointer
singleton = this; singleton = this;
BaseDisplay::GrabGuard gg(*this); grab();
gg.grab();
setupConfigFiles(); setupConfigFiles();