mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-21 13:28:05 +01:00
changed alt-tab behaviour
This commit is contained in:
@@ -128,7 +128,8 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
WMMaskEvent(dpy, KeyPressMask|KeyReleaseMask|ExposureMask
|
WMMaskEvent(dpy, KeyPressMask|KeyReleaseMask|ExposureMask
|
||||||
|PointerMotionMask|ButtonReleaseMask, &ev);
|
|PointerMotionMask|ButtonReleaseMask
|
||||||
|
|LeaveWindowMask, &ev);
|
||||||
|
|
||||||
/* ignore CapsLock */
|
/* ignore CapsLock */
|
||||||
modifiers = ev.xkey.state & ValidModMask;
|
modifiers = ev.xkey.state & ValidModMask;
|
||||||
@@ -205,6 +206,7 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case LeaveNotify:
|
||||||
case MotionNotify:
|
case MotionNotify:
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -95,10 +95,10 @@ static int canReceiveFocus(WWindow *wwin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void changeImage(WSwitchPanel *panel, int index, int selected)
|
static void changeImage(WSwitchPanel *panel, int idecks, int selected)
|
||||||
{
|
{
|
||||||
WMFrame *icon = WMGetFromArray(panel->icons, index);
|
WMFrame *icon = WMGetFromArray(panel->icons, idecks);
|
||||||
RImage *image= WMGetFromArray(panel->images, index);
|
RImage *image= WMGetFromArray(panel->images, idecks);
|
||||||
|
|
||||||
if (!panel->bg && !panel->tile) {
|
if (!panel->bg && !panel->tile) {
|
||||||
if (!selected)
|
if (!selected)
|
||||||
@@ -112,7 +112,7 @@ static void changeImage(WSwitchPanel *panel, int index, int selected)
|
|||||||
WMPoint pos;
|
WMPoint pos;
|
||||||
Pixmap p;
|
Pixmap p;
|
||||||
|
|
||||||
if (canReceiveFocus(WMGetFromArray(panel->windows, index)) < 0)
|
if (canReceiveFocus(WMGetFromArray(panel->windows, idecks)) < 0)
|
||||||
opaq= 50;
|
opaq= 50;
|
||||||
|
|
||||||
pos= WMGetViewPosition(WMWidgetView(icon));
|
pos= WMGetViewPosition(WMWidgetView(icon));
|
||||||
@@ -354,7 +354,7 @@ static RImage *getTile(WSwitchPanel *panel)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
drawTitle(WSwitchPanel *panel, int index, char *title)
|
drawTitle(WSwitchPanel *panel, int idecks, char *title)
|
||||||
{
|
{
|
||||||
char *ntitle;
|
char *ntitle;
|
||||||
int width= WMWidgetWidth(panel->win);
|
int width= WMWidgetWidth(panel->win);
|
||||||
@@ -373,7 +373,7 @@ drawTitle(WSwitchPanel *panel, int index, char *title)
|
|||||||
{
|
{
|
||||||
int w= WMWidthOfString(panel->font, ntitle, strlen(ntitle));
|
int w= WMWidthOfString(panel->font, ntitle, strlen(ntitle));
|
||||||
|
|
||||||
x= BORDER_SPACE+(index-panel->firstVisible)*ICON_TILE_SIZE + ICON_TILE_SIZE/2 - w/2;
|
x= BORDER_SPACE+(idecks-panel->firstVisible)*ICON_TILE_SIZE + ICON_TILE_SIZE/2 - w/2;
|
||||||
if (x < BORDER_SPACE)
|
if (x < BORDER_SPACE)
|
||||||
x= BORDER_SPACE;
|
x= BORDER_SPACE;
|
||||||
else if (x + w > width-BORDER_SPACE)
|
else if (x + w > width-BORDER_SPACE)
|
||||||
@@ -679,12 +679,15 @@ WWindow *wSwitchPanelHandleEvent(WSwitchPanel *panel, XEvent *event)
|
|||||||
{
|
{
|
||||||
WMFrame *icon;
|
WMFrame *icon;
|
||||||
int i;
|
int i;
|
||||||
|
int focus= -1;
|
||||||
|
|
||||||
if (!panel->win)
|
if (!panel->win)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (event->type == MotionNotify) {
|
if (event->type == LeaveNotify) {
|
||||||
int focus= -1;
|
if (event->xcrossing.window == WMWidgetXID(panel->win))
|
||||||
|
focus= 0;
|
||||||
|
} else if (event->type == MotionNotify) {
|
||||||
|
|
||||||
WM_ITERATE_ARRAY(panel->icons, icon, i) {
|
WM_ITERATE_ARRAY(panel->icons, icon, i) {
|
||||||
if (WMWidgetXID(icon) == event->xmotion.window) {
|
if (WMWidgetXID(icon) == event->xmotion.window) {
|
||||||
@@ -692,10 +695,7 @@ WWindow *wSwitchPanelHandleEvent(WSwitchPanel *panel, XEvent *event)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (focus < 0)
|
|
||||||
focus= 0;
|
|
||||||
|
|
||||||
if (focus >= 0 && panel->current != focus) {
|
if (focus >= 0 && panel->current != focus) {
|
||||||
WWindow *wwin;
|
WWindow *wwin;
|
||||||
|
|
||||||
@@ -709,7 +709,6 @@ WWindow *wSwitchPanelHandleEvent(WSwitchPanel *panel, XEvent *event)
|
|||||||
|
|
||||||
return wwin;
|
return wwin;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user