bugfix: only catch first click to raise if we're floating

This commit is contained in:
Julien Danjou 2007-10-11 11:33:40 +02:00
parent 8401eee5f5
commit c05ed01c1a
6 changed files with 23 additions and 19 deletions

View File

@ -72,7 +72,8 @@ grabbuttons(Client * c, Bool focused, Bool raised, KeySym modkey, unsigned int n
if(focused)
{
if (!raised) {
if (!raised)
{
XGrabButton(c->display, Button1, NoSymbol, c->win, False, BUTTONMASK,
GrabModeAsync, GrabModeSync, None, None);
XGrabButton(c->display, Button1, LockMask, c->win, False,
@ -792,7 +793,7 @@ uicb_moveresize(Display *disp __attribute__ ((unused)),
unsigned int dui;
Window dummy;
if(!IS_ARRANGE(layout_floating))
if(!IS_ARRANGE(0, layout_floating))
if(!sel || !sel->isfloating || sel->isfixed || !arg)
return;
if(sscanf(arg, "%s %s %s %s", x, y, w, h) != 4)

19
event.c
View File

@ -201,15 +201,17 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
if((c = getclient(ev->window)))
{
focus(c->display, c, ev->same_screen, &awesomeconf[c->screen]);
if(CLEANMASK(ev->state, c->screen) != awesomeconf[c->screen].modkey) {
if (ev->button == Button1) {
if(CLEANMASK(ev->state, c->screen) != awesomeconf[c->screen].modkey)
{
if (ev->button == Button1)
{
restack(c->display, &awesomeconf[c->screen]);
grabbuttons(c, True, True, awesomeconf->modkey, awesomeconf->numlockmask);
}
}
else if(ev->button == Button1)
{
if(!IS_ARRANGE(layout_floating) && !c->isfloating)
if(!IS_ARRANGE(c->screen, layout_floating) && !c->isfloating)
uicb_togglefloating(e->xany.display, &awesomeconf[c->screen], NULL);
else
restack(e->xany.display, &awesomeconf[c->screen]);
@ -217,14 +219,14 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
}
else if(ev->button == Button2)
{
if(!IS_ARRANGE(layout_floating) && !c->isfixed && c->isfloating)
if(!IS_ARRANGE(c->screen, layout_floating) && !c->isfixed && c->isfloating)
uicb_togglefloating(e->xany.display, &awesomeconf[c->screen], NULL);
else
uicb_zoom(e->xany.display, &awesomeconf[c->screen], NULL);
}
else if(ev->button == Button3)
{
if(!IS_ARRANGE(layout_floating) && !c->isfloating)
if(!IS_ARRANGE(c->screen, layout_floating) && !c->isfloating)
uicb_togglefloating(e->xany.display, &awesomeconf[c->screen], NULL);
else
restack(e->xany.display, &awesomeconf[c->screen]);
@ -261,7 +263,7 @@ handle_event_configurerequest(XEvent * e, awesome_config *awesomeconf)
c->ismax = False;
if(ev->value_mask & CWBorderWidth)
c->border = ev->border_width;
if(c->isfixed || c->isfloating || IS_ARRANGE(layout_floating))
if(c->isfixed || c->isfloating || IS_ARRANGE(c->screen, layout_floating))
{
if(ev->value_mask & CWX)
c->x = ev->x;
@ -345,9 +347,10 @@ handle_event_enternotify(XEvent * e, awesome_config *awesomeconf)
if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
return;
if((c = getclient(ev->window))) {
if((c = getclient(ev->window)))
{
focus(c->display, c, ev->same_screen, &awesomeconf[c->screen]);
if (sel)
if (sel && (sel->isfloating || IS_ARRANGE(sel->screen, layout_floating)))
grabbuttons(sel, True, False, awesomeconf->modkey, awesomeconf->numlockmask);
}
else

View File

@ -126,9 +126,9 @@ restack(Display * disp, awesome_config *awesomeconf)
drawstatusbar(disp, awesomeconf);
if(!sel)
return;
if(sel->isfloating || IS_ARRANGE(layout_floating))
if(sel->isfloating || IS_ARRANGE(0, layout_floating))
XRaiseWindow(disp, sel->win);
if(!IS_ARRANGE(layout_floating))
if(!IS_ARRANGE(0, layout_floating))
{
wc.stack_mode = Below;
wc.sibling = awesomeconf->statusbar.window;

View File

@ -25,7 +25,7 @@
#include "client.h"
/** Check if current layout is arranged with a layout */
#define IS_ARRANGE(layout) (layout == awesomeconf->current_layout->arrange)
#define IS_ARRANGE(screen, layout) (layout == awesomeconf[screen].current_layout->arrange)
#define AWESOMEPROPS_ATOM(disp) XInternAtom(disp, "_AWESOME_PROPERTIES", False)

View File

@ -36,7 +36,7 @@ uicb_setnmaster(Display *disp,
awesome_config *awesomeconf,
const char * arg)
{
if(!arg || (!IS_ARRANGE(layout_tile) && !IS_ARRANGE(layout_tileleft)))
if(!arg || (!IS_ARRANGE(0, layout_tile) && !IS_ARRANGE(0, layout_tileleft)))
return;
@ -51,7 +51,7 @@ uicb_setncol(Display *disp,
awesome_config *awesomeconf,
const char * arg)
{
if(!arg || (!IS_ARRANGE(layout_tile) && !IS_ARRANGE(layout_tileleft)))
if(!arg || (!IS_ARRANGE(0, layout_tile) && !IS_ARRANGE(0, layout_tileleft)))
return;
if((awesomeconf->ncol = (int) compute_new_value_from_arg(arg, (double) awesomeconf->ncol)) < 1)
@ -67,11 +67,11 @@ uicb_setmwfact(Display *disp,
{
char *newarg;
if((!IS_ARRANGE(layout_tile) && !IS_ARRANGE(layout_tileleft)) || !arg)
if((!IS_ARRANGE(0, layout_tile) && !IS_ARRANGE(0, layout_tileleft)) || !arg)
return;
newarg = a_strdup(arg);
if(IS_ARRANGE(layout_tileleft))
if(IS_ARRANGE(0, layout_tileleft))
{
if(newarg[0] == '+')
newarg[0] = '-';

View File

@ -134,7 +134,7 @@ drawstatusbar(Display *disp, awesome_config * awesomeconf)
sel->ismax,
awesomeconf->colors_selected[ColFG]);
}
else if(IS_ARRANGE(layout_tile) || IS_ARRANGE(layout_tileleft))
else if(IS_ARRANGE(0, layout_tile) || IS_ARRANGE(0, layout_tileleft))
{
char buf[256];
snprintf(buf, sizeof(buf), "nmaster: %d ncol: %d mwfact: %.2lf", awesomeconf->nmaster, awesomeconf->ncol, awesomeconf->mwfact);