Mouse/Typo: Improve client tile move system (Remove break after swap).

This commit is contained in:
Martin Duquesnoy 2009-08-21 17:18:52 +02:00
parent c97cc8a7db
commit 8a3111fb75
6 changed files with 27 additions and 32 deletions

View File

@ -380,11 +380,9 @@ client_hide(Client *c)
Bool
ishide(Client *c, int screen)
{
screen_get_sel();
if(c->tag == seltag[screen]
&& c->screen == screen)
if(c->tag == seltag[screen] && c->screen == screen)
return False;
return True;
}

View File

@ -84,7 +84,6 @@ buttonpress(XButtonEvent *ev)
if(conf.root.mouse[i].func)
conf.root.mouse[i].func(conf.root.mouse[i].cmd);
/* Infobars */
for(i = 0; i < screen_count(); ++i)
if(ev->window == infobar[i].bar->win)
@ -561,7 +560,7 @@ getevent(XEvent ev)
for(; argv_global[0] && argv_global[0] == ' '; ++argv_global);
execlp(argv_global, argv_global, NULL);
}
#endif
#endif /* HAVE_XRANDR */
break;
}

View File

@ -102,11 +102,11 @@ mouse_move(Client *c)
|| (sclient = client_gb_frame(sw))
|| (sclient = client_gb_titlebar(sw)))
{
if(c != sclient)
if(c->win != sclient->win)
{
client_swap(c, sclient);
client_swap(sclient, c);
client_focus(sclient);
break;
swap_ptr((void**)&c, (void**)&sclient);
}
}

View File

@ -45,7 +45,7 @@ screen_count(void)
#ifdef HAVE_XINERAMA
if(XineramaIsActive(dpy))
XineramaQueryScreens(dpy, &n);
#endif
#endif /* HAVE_XINERAMA */
/* Set _WMFS_SCREEN_COUNT */
XChangeProperty(dpy, ROOT, net_atom[wmfs_screen_count], XA_CARDINAL, 32,
@ -90,7 +90,7 @@ screen_get_geo(int s)
XFree(xsi);
}
#endif
#endif /* HAVE_XINERAMA */
return geo;
}
@ -150,7 +150,7 @@ screen_get_sel(void)
selscreen = screen_get_with_geo(x, y);
}
#endif
#endif /* HAVE_XINERAMA */
/* Set _WMFS_CURRENT_SCREEN */
XChangeProperty(dpy, ROOT, net_atom[wmfs_current_screen], XA_CARDINAL, 32,
@ -193,7 +193,7 @@ screen_init_geo(void)
}
XFree(xsi);
}
#endif
#endif /* HAVE_XINERAMA */
#ifdef HAVE_XRANDR
/* Init xrandr stuff */
@ -201,7 +201,7 @@ screen_init_geo(void)
XRRSelectInput(dpy, ROOT, 1);
XRRQueryExtension(dpy, &xrandr_event, &d);
#endif
#endif /* HAVE_XRANDR */
ewmh_set_desktop_geometry();
ewmh_set_workarea();

View File

@ -141,7 +141,7 @@ struct Client
/* Client title */
char *title;
/* Tag num */
int tag;
uint tag;
/* Screen */
int screen;
/* Window attribute */

View File

@ -59,47 +59,45 @@
/* Optional dependences */
#ifdef HAVE_XINERAMA
#include <X11/extensions/Xinerama.h>
#endif
#endif /* HAVE_XINERAMA */
#ifdef HAVE_XRANDR
#include <X11/extensions/Xrandr.h>
#endif
#endif /* HAVE_XINERAMA */
/* MACRO */
#define ButtonMask (ButtonPressMask | ButtonReleaseMask | ButtonMotionMask)
#define MouseMask (ButtonMask | PointerMotionMask)
#define KeyMask (KeyPressMask | KeyReleaseMask)
#define CWIN(win, parent, x, y, w, h, b, mask, col, at) \
do { \
win = XCreateWindow(dpy, (parent), (x), (y), (w), (h), (b), CopyFromParent, \
InputOutput, CopyFromParent, (mask), (at)); \
XSetWindowBackground(dpy, win, (col)); \
} while (/*CONSTCOND*/0)
#define SCREEN DefaultScreen(dpy)
#define ROOT RootWindow(dpy, SCREEN)
#define MAXH DisplayHeight(dpy, DefaultScreen(dpy))
#define MAXW DisplayWidth(dpy, DefaultScreen(dpy))
#define ATOM(a) XInternAtom(dpy, (a), False)
#define INFOBARH ((conf.bars.height > 0) ? conf.bars.height : (font->height * 1.5))
#define FHINFOBAR ((font->height - font->descent) + (INFOBARH - font->height) / 2)
#define SHADH (1)
#define SHADC (0x000000) /* 'Cause i don't know how darken a color yet */
#define BORDH conf.client.borderheight
#define TBARH ((conf.titlebar.height < BORDH) ? BORDH : conf.titlebar.height)
#define RESHW (6 * BORDH)
#define BUTTONWH (TBARH / 2)
#define DEF_CONF ".config/wmfs/wmfsrc"
#define PAD conf.pad
#define CWIN(win, parent, x, y, w, h, b, mask, col, at) \
do { \
win = XCreateWindow(dpy, (parent), (x), (y), (w), (h), (b), CopyFromParent, \
InputOutput, CopyFromParent, (mask), (at)); \
XSetWindowBackground(dpy, win, (col)); \
} while (/* CONSTCOND */ 0)
#define ATOM(a) XInternAtom(dpy, (a), False)
#define FRAMEW(w) ((w) + BORDH * 2)
#define FRAMEH(h) ((h) + (BORDH + TBARH))
#define ROUND(x) (float)((x > 0) ? x + (float)0.5 : x - (float)0.5)
#define RESHW (6 * BORDH)
#define BUTTONWH (TBARH / 2)
#define CHECK(x) if(!(x)) return
#define IFREE(x) if(x) free(x)
#define LEN(x) (sizeof(x) / sizeof((x)[0]))
#define deb(p) fprintf(stderr, "debug: %d\n", (p))
#define DEF_CONF ".config/wmfs/wmfsrc"
#define PAD conf.pad
/* barwin.c */
BarWindow *barwin_create(Window parent,