mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
more bug fixes..
This commit is contained in:
@@ -26,6 +26,10 @@
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/keysym.h>
|
||||
|
||||
// TODO: remove non-MOX_CYCLING junk
|
||||
// fix the stacking/window raising during alt-tabbing
|
||||
// allow selection of icons with mouse
|
||||
|
||||
#define MOX_CYCLING
|
||||
|
||||
#include "WindowMaker.h"
|
||||
@@ -190,13 +194,15 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
||||
#ifdef MOX_CYCLING
|
||||
WSwitchPanel *swpanel = NULL;
|
||||
#endif
|
||||
KeyCode leftKey, rightKey;
|
||||
KeyCode leftKey, rightKey, homeKey, endKey;
|
||||
|
||||
if (!wwin)
|
||||
return;
|
||||
|
||||
leftKey = XKeysymToKeycode(dpy, XK_Left);
|
||||
rightKey = XKeysymToKeycode(dpy, XK_Right);
|
||||
homeKey = XKeysymToKeycode(dpy, XK_Home);
|
||||
endKey = XKeysymToKeycode(dpy, XK_End);
|
||||
|
||||
if (next)
|
||||
hasModifier = (wKeyBindings[WKBD_FOCUSNEXT].modifier != 0);
|
||||
@@ -307,6 +313,14 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
||||
XRaiseWindow(dpy, newFocused->frame->core->window);
|
||||
}
|
||||
#endif /* !MOX_CYCLING */
|
||||
} else if (ev.xkey.keycode == homeKey || ev.xkey.keycode == endKey) {
|
||||
if (swpanel) {
|
||||
newFocused = wSwitchPanelSelectFirst(swpanel, ev.xkey.keycode != homeKey);
|
||||
if (newFocused) {
|
||||
wWindowFocus(newFocused, oldFocused);
|
||||
oldFocused = newFocused;
|
||||
}
|
||||
}
|
||||
} else if (ev.type == MotionNotify) {
|
||||
WWindow *tmp;
|
||||
if (swpanel) {
|
||||
|
||||
@@ -133,6 +133,8 @@ extern WPreferences wPreferences;
|
||||
|
||||
static int canReceiveFocus(WWindow *wwin)
|
||||
{
|
||||
if (wwin->frame->workspace != wwin->screen_ptr->current_workspace)
|
||||
return 0;
|
||||
if (!wwin->flags.mapped)
|
||||
{
|
||||
if (!wwin->flags.shaded && !wwin->flags.miniaturized && !wwin->flags.hidden)
|
||||
@@ -142,8 +144,6 @@ static int canReceiveFocus(WWindow *wwin)
|
||||
}
|
||||
if (WFLAGP(wwin, no_focusable))
|
||||
return 0;
|
||||
if (wwin->frame->workspace != wwin->screen_ptr->current_workspace)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -364,7 +364,6 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, int workspace)
|
||||
|
||||
WMMapSubwidgets(panel->win);
|
||||
WMRealizeWidget(panel->win);
|
||||
WMMapWidget(panel->win);
|
||||
{
|
||||
WMPoint center;
|
||||
|
||||
@@ -376,7 +375,9 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, int workspace)
|
||||
panel->current= WMGetFirstInArray(panel->windows, curwin);
|
||||
if (panel->current >= 0)
|
||||
changeImage(panel, panel->current, 1);
|
||||
|
||||
|
||||
WMMapWidget(panel->win);
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
||||
@@ -433,6 +434,32 @@ WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int back)
|
||||
}
|
||||
|
||||
|
||||
WWindow *wSwitchPanelSelectFirst(WSwitchPanel *panel, int back)
|
||||
{
|
||||
WWindow *wwin;
|
||||
int count = WMGetArrayItemCount(panel->windows);
|
||||
|
||||
if (count == 0)
|
||||
return NULL;
|
||||
|
||||
if (panel->win)
|
||||
changeImage(panel, panel->current, 0);
|
||||
|
||||
if (!back)
|
||||
panel->current = count-1;
|
||||
else
|
||||
panel->current = 0;
|
||||
|
||||
wwin = WMGetFromArray(panel->windows, panel->current);
|
||||
|
||||
if (panel->win) {
|
||||
WMSetLabelText(panel->label, wwin->frame->title);
|
||||
|
||||
changeImage(panel, panel->current, 1);
|
||||
}
|
||||
return wwin;
|
||||
}
|
||||
|
||||
|
||||
WWindow *wSwitchPanelHandleEvent(WSwitchPanel *panel, XEvent *event)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,7 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, int workspace);
|
||||
void wSwitchPanelDestroy(WSwitchPanel *panel);
|
||||
|
||||
WWindow *wSwitchPanelSelectNext(WSwitchPanel *panel, int back);
|
||||
WWindow *wSwitchPanelSelectFirst(WSwitchPanel *panel, int back);
|
||||
|
||||
WWindow *wSwitchPanelHandleEvent(WSwitchPanel *panel, XEvent *event);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user