mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
Variable current_workspace moved to workspace object in global namespace
The variable current_workspace, that contains the current workspace is moved to the global workspace properties. Now the screen is not needed to know the workspace_count.
This commit is contained in:
committed by
Carlos R. Mafra
parent
e5ae684d02
commit
c610b8d7ce
@@ -484,6 +484,7 @@ extern struct wmaker_global_variables {
|
|||||||
/* Workspace related */
|
/* Workspace related */
|
||||||
struct {
|
struct {
|
||||||
int count; /* number of workspaces */
|
int count; /* number of workspaces */
|
||||||
|
int current; /* current workspace number */
|
||||||
int last_used; /* last used workspace number */
|
int last_used; /* last used workspace number */
|
||||||
|
|
||||||
WMFont *font_for_name; /* used during workspace switch */
|
WMFont *font_for_name; /* used during workspace switch */
|
||||||
|
|||||||
@@ -602,8 +602,8 @@ static void find_Maximus_geometry(WWindow *wwin, WArea usableArea, int *new_x, i
|
|||||||
/* The focused window is always the last in the list */
|
/* The focused window is always the last in the list */
|
||||||
while (tmp->prev) {
|
while (tmp->prev) {
|
||||||
/* ignore windows in other workspaces etc */
|
/* ignore windows in other workspaces etc */
|
||||||
if (tmp->prev->frame->workspace != wwin->screen_ptr->current_workspace
|
if (tmp->prev->frame->workspace != w_global.workspace.current ||
|
||||||
|| tmp->prev->flags.miniaturized || tmp->prev->flags.hidden) {
|
tmp->prev->flags.miniaturized || tmp->prev->flags.hidden) {
|
||||||
tmp = tmp->prev;
|
tmp = tmp->prev;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -629,8 +629,8 @@ static void find_Maximus_geometry(WWindow *wwin, WArea usableArea, int *new_x, i
|
|||||||
|
|
||||||
tmp = wwin;
|
tmp = wwin;
|
||||||
while (tmp->prev) {
|
while (tmp->prev) {
|
||||||
if (tmp->prev->frame->workspace != wwin->screen_ptr->current_workspace
|
if (tmp->prev->frame->workspace != w_global.workspace.current ||
|
||||||
|| tmp->prev->flags.miniaturized || tmp->prev->flags.hidden) {
|
tmp->prev->flags.miniaturized || tmp->prev->flags.hidden) {
|
||||||
tmp = tmp->prev;
|
tmp = tmp->prev;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1067,7 +1067,7 @@ void wIconifyWindow(WWindow * wwin)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
present = wwin->frame->workspace == wwin->screen_ptr->current_workspace;
|
present = wwin->frame->workspace == w_global.workspace.current;
|
||||||
|
|
||||||
/* if the window is in another workspace, simplify process */
|
/* if the window is in another workspace, simplify process */
|
||||||
if (present) {
|
if (present) {
|
||||||
@@ -1136,7 +1136,7 @@ void wIconifyWindow(WWindow * wwin)
|
|||||||
wwin->flags.skip_next_animation = 0;
|
wwin->flags.skip_next_animation = 0;
|
||||||
|
|
||||||
if (!wPreferences.disable_miniwindows && !wwin->flags.net_handle_icon) {
|
if (!wPreferences.disable_miniwindows && !wwin->flags.net_handle_icon) {
|
||||||
if (wwin->screen_ptr->current_workspace == wwin->frame->workspace ||
|
if (w_global.workspace.current == wwin->frame->workspace ||
|
||||||
IS_OMNIPRESENT(wwin) || wPreferences.sticky_icons)
|
IS_OMNIPRESENT(wwin) || wPreferences.sticky_icons)
|
||||||
XMapWindow(dpy, wwin->icon->core->window);
|
XMapWindow(dpy, wwin->icon->core->window);
|
||||||
|
|
||||||
@@ -1203,10 +1203,10 @@ void wDeiconifyWindow(WWindow *wwin)
|
|||||||
|
|
||||||
/* we're hiding for show_desktop */
|
/* we're hiding for show_desktop */
|
||||||
int netwm_hidden = wwin->flags.net_show_desktop &&
|
int netwm_hidden = wwin->flags.net_show_desktop &&
|
||||||
wwin->frame->workspace != wwin->screen_ptr->current_workspace;
|
wwin->frame->workspace != w_global.workspace.current;
|
||||||
|
|
||||||
if (!netwm_hidden)
|
if (!netwm_hidden)
|
||||||
wWindowChangeWorkspace(wwin, wwin->screen_ptr->current_workspace);
|
wWindowChangeWorkspace(wwin, w_global.workspace.current);
|
||||||
|
|
||||||
if (!wwin->flags.miniaturized) {
|
if (!wwin->flags.miniaturized) {
|
||||||
ignore_wks_change = 0;
|
ignore_wks_change = 0;
|
||||||
@@ -1399,7 +1399,7 @@ void wHideAll(WScreen *scr)
|
|||||||
|
|
||||||
for (i = 0; i < wcount; i++) {
|
for (i = 0; i < wcount; i++) {
|
||||||
wwin = windows[i];
|
wwin = windows[i];
|
||||||
if (wwin->frame->workspace == scr->current_workspace
|
if (wwin->frame->workspace == w_global.workspace.current
|
||||||
&& !(wwin->flags.miniaturized || wwin->flags.hidden)
|
&& !(wwin->flags.miniaturized || wwin->flags.hidden)
|
||||||
&& !wwin->flags.internal_window
|
&& !wwin->flags.internal_window
|
||||||
&& !WFLAGP(wwin, no_miniaturizable)
|
&& !WFLAGP(wwin, no_miniaturizable)
|
||||||
@@ -1423,7 +1423,7 @@ void wHideOtherApplications(WWindow *awin)
|
|||||||
|
|
||||||
while (wwin) {
|
while (wwin) {
|
||||||
if (wwin != awin
|
if (wwin != awin
|
||||||
&& wwin->frame->workspace == awin->screen_ptr->current_workspace
|
&& wwin->frame->workspace == w_global.workspace.current
|
||||||
&& !(wwin->flags.miniaturized || wwin->flags.hidden)
|
&& !(wwin->flags.miniaturized || wwin->flags.hidden)
|
||||||
&& !wwin->flags.internal_window
|
&& !wwin->flags.internal_window
|
||||||
&& wGetWindowOfInspectorForWindow(wwin) != awin && !WFLAGP(wwin, no_hide_others)) {
|
&& wGetWindowOfInspectorForWindow(wwin) != awin && !WFLAGP(wwin, no_hide_others)) {
|
||||||
@@ -1526,7 +1526,7 @@ void wHideApplication(WApplication *wapp)
|
|||||||
static void unhideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int animate, int bringToCurrentWS)
|
static void unhideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int animate, int bringToCurrentWS)
|
||||||
{
|
{
|
||||||
if (bringToCurrentWS)
|
if (bringToCurrentWS)
|
||||||
wWindowChangeWorkspace(wwin, wwin->screen_ptr->current_workspace);
|
wWindowChangeWorkspace(wwin, w_global.workspace.current);
|
||||||
|
|
||||||
wwin->flags.hidden = 0;
|
wwin->flags.hidden = 0;
|
||||||
|
|
||||||
@@ -1539,7 +1539,7 @@ static void unhideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
wwin->flags.skip_next_animation = 0;
|
wwin->flags.skip_next_animation = 0;
|
||||||
if (wwin->screen_ptr->current_workspace == wwin->frame->workspace) {
|
if (w_global.workspace.current == wwin->frame->workspace) {
|
||||||
XMapWindow(dpy, wwin->client_win);
|
XMapWindow(dpy, wwin->client_win);
|
||||||
XMapWindow(dpy, wwin->frame->core->window);
|
XMapWindow(dpy, wwin->frame->core->window);
|
||||||
wClientSetState(wwin, NormalState, None);
|
wClientSetState(wwin, NormalState, None);
|
||||||
@@ -1585,7 +1585,7 @@ void wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurren
|
|||||||
|
|
||||||
if (wlist->flags.miniaturized) {
|
if (wlist->flags.miniaturized) {
|
||||||
if ((bringToCurrentWS || wPreferences.sticky_icons ||
|
if ((bringToCurrentWS || wPreferences.sticky_icons ||
|
||||||
wlist->frame->workspace == scr->current_workspace) && wlist->icon) {
|
wlist->frame->workspace == w_global.workspace.current) && wlist->icon) {
|
||||||
if (!wlist->icon->mapped) {
|
if (!wlist->icon->mapped) {
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
@@ -1601,18 +1601,18 @@ void wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurren
|
|||||||
wRaiseFrame(wlist->icon->core);
|
wRaiseFrame(wlist->icon->core);
|
||||||
}
|
}
|
||||||
if (bringToCurrentWS)
|
if (bringToCurrentWS)
|
||||||
wWindowChangeWorkspace(wlist, scr->current_workspace);
|
wWindowChangeWorkspace(wlist, w_global.workspace.current);
|
||||||
wlist->flags.hidden = 0;
|
wlist->flags.hidden = 0;
|
||||||
if (miniwindows && wlist->frame->workspace == scr->current_workspace) {
|
if (miniwindows && wlist->frame->workspace == w_global.workspace.current) {
|
||||||
wDeiconifyWindow(wlist);
|
wDeiconifyWindow(wlist);
|
||||||
}
|
}
|
||||||
WMPostNotificationName(WMNChangedState, wlist, "hide");
|
WMPostNotificationName(WMNChangedState, wlist, "hide");
|
||||||
} else if (wlist->flags.shaded) {
|
} else if (wlist->flags.shaded) {
|
||||||
if (bringToCurrentWS)
|
if (bringToCurrentWS)
|
||||||
wWindowChangeWorkspace(wlist, scr->current_workspace);
|
wWindowChangeWorkspace(wlist, w_global.workspace.current);
|
||||||
wlist->flags.hidden = 0;
|
wlist->flags.hidden = 0;
|
||||||
wRaiseFrame(wlist->frame->core);
|
wRaiseFrame(wlist->frame->core);
|
||||||
if (wlist->frame->workspace == scr->current_workspace) {
|
if (wlist->frame->workspace == w_global.workspace.current) {
|
||||||
XMapWindow(dpy, wlist->frame->core->window);
|
XMapWindow(dpy, wlist->frame->core->window);
|
||||||
if (miniwindows) {
|
if (miniwindows) {
|
||||||
wUnshadeWindow(wlist);
|
wUnshadeWindow(wlist);
|
||||||
@@ -1624,8 +1624,8 @@ void wUnhideApplication(WApplication *wapp, Bool miniwindows, Bool bringToCurren
|
|||||||
wapp->app_icon->y_pos, wlist, animate, bringToCurrentWS);
|
wapp->app_icon->y_pos, wlist, animate, bringToCurrentWS);
|
||||||
animate = False;
|
animate = False;
|
||||||
} else {
|
} else {
|
||||||
if (bringToCurrentWS && wlist->frame->workspace != scr->current_workspace)
|
if (bringToCurrentWS && wlist->frame->workspace != w_global.workspace.current)
|
||||||
wWindowChangeWorkspace(wlist, scr->current_workspace);
|
wWindowChangeWorkspace(wlist, w_global.workspace.current);
|
||||||
|
|
||||||
wRaiseFrame(wlist->frame->core);
|
wRaiseFrame(wlist->frame->core);
|
||||||
}
|
}
|
||||||
@@ -1659,7 +1659,7 @@ void wShowAllWindows(WScreen *scr)
|
|||||||
old_foc = wwin = scr->focused_window;
|
old_foc = wwin = scr->focused_window;
|
||||||
while (wwin) {
|
while (wwin) {
|
||||||
if (!wwin->flags.internal_window &&
|
if (!wwin->flags.internal_window &&
|
||||||
(scr->current_workspace == wwin->frame->workspace || IS_OMNIPRESENT(wwin))) {
|
(w_global.workspace.current == wwin->frame->workspace || IS_OMNIPRESENT(wwin))) {
|
||||||
if (wwin->flags.miniaturized) {
|
if (wwin->flags.miniaturized) {
|
||||||
wwin->flags.skip_next_animation = 1;
|
wwin->flags.skip_next_animation = 1;
|
||||||
wDeiconifyWindow(wwin);
|
wDeiconifyWindow(wwin);
|
||||||
@@ -1802,7 +1802,7 @@ void wArrangeIcons(WScreen *scr, Bool arrangeAll)
|
|||||||
|
|
||||||
while (wwin) {
|
while (wwin) {
|
||||||
if (wwin->icon && wwin->flags.miniaturized && !wwin->flags.hidden &&
|
if (wwin->icon && wwin->flags.miniaturized && !wwin->flags.hidden &&
|
||||||
(wwin->frame->workspace == scr->current_workspace ||
|
(wwin->frame->workspace == w_global.workspace.current ||
|
||||||
IS_OMNIPRESENT(wwin) || wPreferences.sticky_icons)) {
|
IS_OMNIPRESENT(wwin) || wPreferences.sticky_icons)) {
|
||||||
|
|
||||||
head = wGetHeadForWindow(wwin);
|
head = wGetHeadForWindow(wwin);
|
||||||
@@ -1868,7 +1868,7 @@ void wSelectWindow(WWindow *wwin, Bool flag)
|
|||||||
|
|
||||||
void wMakeWindowVisible(WWindow *wwin)
|
void wMakeWindowVisible(WWindow *wwin)
|
||||||
{
|
{
|
||||||
if (wwin->frame->workspace != wwin->screen_ptr->current_workspace)
|
if (wwin->frame->workspace != w_global.workspace.current)
|
||||||
wWorkspaceChange(wwin->screen_ptr, wwin->frame->workspace);
|
wWorkspaceChange(wwin->screen_ptr, wwin->frame->workspace);
|
||||||
|
|
||||||
if (wwin->flags.shaded)
|
if (wwin->flags.shaded)
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ void unpaint_app_icon(WApplication *wapp)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
scr = wapp->main_window_desc->screen_ptr;
|
scr = wapp->main_window_desc->screen_ptr;
|
||||||
clip = scr->workspaces[scr->current_workspace]->clip;
|
clip = scr->workspaces[w_global.workspace.current]->clip;
|
||||||
|
|
||||||
if (!clip || !aicon->attracted || !clip->collapsed)
|
if (!clip || !aicon->attracted || !clip->collapsed)
|
||||||
XUnmapWindow(dpy, aicon->icon->core->window);
|
XUnmapWindow(dpy, aicon->icon->core->window);
|
||||||
@@ -217,7 +217,7 @@ void paint_app_icon(WApplication *wapp)
|
|||||||
|
|
||||||
attracting_dock = scr->attracting_drawer != NULL ?
|
attracting_dock = scr->attracting_drawer != NULL ?
|
||||||
scr->attracting_drawer :
|
scr->attracting_drawer :
|
||||||
scr->workspaces[scr->current_workspace]->clip;
|
scr->workspaces[w_global.workspace.current]->clip;
|
||||||
if (attracting_dock && attracting_dock->attract_icons &&
|
if (attracting_dock && attracting_dock->attract_icons &&
|
||||||
wDockFindFreeSlot(attracting_dock, &x, &y)) {
|
wDockFindFreeSlot(attracting_dock, &x, &y)) {
|
||||||
wapp->app_icon->attracted = 1;
|
wapp->app_icon->attracted = 1;
|
||||||
@@ -382,7 +382,7 @@ static void updateDockNumbers(WScreen *scr)
|
|||||||
WAppIcon *dicon = scr->dock->icon_array[0];
|
WAppIcon *dicon = scr->dock->icon_array[0];
|
||||||
|
|
||||||
ws_numbers = wmalloc(20);
|
ws_numbers = wmalloc(20);
|
||||||
snprintf(ws_numbers, 20, "%i [ %i ]", scr->current_workspace + 1, ((scr->current_workspace / 10) + 1));
|
snprintf(ws_numbers, 20, "%i [ %i ]", w_global.workspace.current + 1, ((w_global.workspace.current / 10) + 1));
|
||||||
length = strlen(ws_numbers);
|
length = strlen(ws_numbers);
|
||||||
|
|
||||||
XClearArea(dpy, dicon->icon->core->window, 2, 2, 50, WMFontHeight(scr->icon_title_font) + 1, False);
|
XClearArea(dpy, dicon->icon->core->window, 2, 2, 50, WMFontHeight(scr->icon_title_font) + 1, False);
|
||||||
@@ -667,7 +667,7 @@ static void iconDblClick(WObjDescriptor *desc, XEvent *event)
|
|||||||
|
|
||||||
unhideHere = (event->xbutton.state & ShiftMask);
|
unhideHere = (event->xbutton.state & ShiftMask);
|
||||||
/* go to the last workspace that the user worked on the app */
|
/* go to the last workspace that the user worked on the app */
|
||||||
if (!unhideHere && wapp->last_workspace != scr->current_workspace)
|
if (!unhideHere && wapp->last_workspace != w_global.workspace.current)
|
||||||
wWorkspaceChange(scr, wapp->last_workspace);
|
wWorkspaceChange(scr, wapp->last_workspace);
|
||||||
|
|
||||||
wUnhideApplication(wapp, event->xbutton.button == Button2, unhideHere);
|
wUnhideApplication(wapp, event->xbutton.button == Button2, unhideHere);
|
||||||
@@ -809,8 +809,8 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event)
|
|||||||
allDocks[ i++ ] = scr->dock;
|
allDocks[ i++ ] = scr->dock;
|
||||||
|
|
||||||
if (!wPreferences.flags.noclip &&
|
if (!wPreferences.flags.noclip &&
|
||||||
originalDock != scr->workspaces[scr->current_workspace]->clip)
|
originalDock != scr->workspaces[w_global.workspace.current]->clip)
|
||||||
allDocks[ i++ ] = scr->workspaces[scr->current_workspace]->clip;
|
allDocks[ i++ ] = scr->workspaces[w_global.workspace.current]->clip;
|
||||||
|
|
||||||
for ( ; i < scr->drawer_count + 2; i++) /* In case the clip, the dock, or both, are disabled */
|
for ( ; i < scr->drawer_count + 2; i++) /* In case the clip, the dock, or both, are disabled */
|
||||||
allDocks[ i ] = NULL;
|
allDocks[ i ] = NULL;
|
||||||
@@ -862,7 +862,7 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event)
|
|||||||
if (omnipresent && !showed_all_clips) {
|
if (omnipresent && !showed_all_clips) {
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < w_global.workspace.count; i++) {
|
for (i = 0; i < w_global.workspace.count; i++) {
|
||||||
if (i == scr->current_workspace)
|
if (i == w_global.workspace.current)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
wDockShowIcons(scr->workspaces[i]->clip);
|
wDockShowIcons(scr->workspaces[i]->clip);
|
||||||
@@ -1068,7 +1068,7 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event)
|
|||||||
if (showed_all_clips) {
|
if (showed_all_clips) {
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < w_global.workspace.count; i++) {
|
for (i = 0; i < w_global.workspace.count; i++) {
|
||||||
if (i == scr->current_workspace)
|
if (i == w_global.workspace.current)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
wDockHideIcons(scr->workspaces[i]->clip);
|
wDockHideIcons(scr->workspaces[i]->clip);
|
||||||
|
|||||||
@@ -440,8 +440,8 @@ static void appiconBalloon(WObjDescriptor *object)
|
|||||||
|
|
||||||
/* Show balloon if it is the Clip and the workspace name is > 5 chars */
|
/* Show balloon if it is the Clip and the workspace name is > 5 chars */
|
||||||
if (object->parent == scr->clip_icon) {
|
if (object->parent == scr->clip_icon) {
|
||||||
if (strlen(scr->workspaces[scr->current_workspace]->name) > 5) {
|
if (strlen(scr->workspaces[w_global.workspace.current]->name) > 5) {
|
||||||
scr->balloon->text = wstrdup(scr->workspaces[scr->current_workspace]->name);
|
scr->balloon->text = wstrdup(scr->workspaces[w_global.workspace.current]->name);
|
||||||
} else {
|
} else {
|
||||||
wBalloonHide(scr);
|
wBalloonHide(scr);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ void StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next, Bool class_only)
|
|||||||
|
|
||||||
oldFocused = change_focus_and_raise(newFocused, oldFocused, swpanel, scr, False);
|
oldFocused = change_focus_and_raise(newFocused, oldFocused, swpanel, scr, False);
|
||||||
} else {
|
} else {
|
||||||
if (wwin->frame->workspace == scr->current_workspace)
|
if (wwin->frame->workspace == w_global.workspace.current)
|
||||||
newFocused = wwin;
|
newFocused = wwin;
|
||||||
else
|
else
|
||||||
newFocused = NULL;
|
newFocused = NULL;
|
||||||
|
|||||||
@@ -2452,7 +2452,7 @@ static int setWrapAppiconsInDock(WScreen *scr, WDefaultEntry *entry, void *tdata
|
|||||||
static int setStickyIcons(WScreen * scr, WDefaultEntry * entry, void *bar, void *foo)
|
static int setStickyIcons(WScreen * scr, WDefaultEntry * entry, void *bar, void *foo)
|
||||||
{
|
{
|
||||||
if (scr->workspaces) {
|
if (scr->workspaces) {
|
||||||
wWorkspaceForceChange(scr, scr->current_workspace);
|
wWorkspaceForceChange(scr, w_global.workspace.current);
|
||||||
wArrangeIcons(scr, False);
|
wArrangeIcons(scr, False);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -2882,7 +2882,7 @@ static int setWorkspaceBack(WScreen * scr, WDefaultEntry * entry, void *tdata, v
|
|||||||
if (str) {
|
if (str) {
|
||||||
SendHelperMessage(scr, 'S', 0, str);
|
SendHelperMessage(scr, 'S', 0, str);
|
||||||
wfree(str);
|
wfree(str);
|
||||||
SendHelperMessage(scr, 'C', scr->current_workspace + 1, NULL);
|
SendHelperMessage(scr, 'C', w_global.workspace.current + 1, NULL);
|
||||||
} else {
|
} else {
|
||||||
SendHelperMessage(scr, 'U', 0, NULL);
|
SendHelperMessage(scr, 'U', 0, NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
38
src/dock.c
38
src/dock.c
@@ -171,7 +171,7 @@ static void renameCallback(WMenu *menu, WMenuEntry *entry)
|
|||||||
|
|
||||||
assert(entry->clientdata != NULL);
|
assert(entry->clientdata != NULL);
|
||||||
|
|
||||||
wspace = dock->screen_ptr->current_workspace;
|
wspace = w_global.workspace.current;
|
||||||
|
|
||||||
name = wstrdup(dock->screen_ptr->workspaces[wspace]->name);
|
name = wstrdup(dock->screen_ptr->workspaces[wspace]->name);
|
||||||
|
|
||||||
@@ -865,7 +865,7 @@ static void switchWSCommand(WMenu *menu, WMenuEntry *entry)
|
|||||||
WMArray *selectedIcons;
|
WMArray *selectedIcons;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
if (entry->order == scr->current_workspace)
|
if (entry->order == w_global.workspace.current)
|
||||||
return;
|
return;
|
||||||
src = icon->dock;
|
src = icon->dock;
|
||||||
dest = scr->workspaces[entry->order]->clip;
|
dest = scr->workspaces[entry->order]->clip;
|
||||||
@@ -959,7 +959,7 @@ static void updateWorkspaceMenu(WMenu *menu, WAppIcon *icon)
|
|||||||
menu->flags.realized = 0;
|
menu->flags.realized = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == scr->current_workspace)
|
if (i == w_global.workspace.current)
|
||||||
wMenuSetEnabled(menu, i, False);
|
wMenuSetEnabled(menu, i, False);
|
||||||
else
|
else
|
||||||
wMenuSetEnabled(menu, i, True);
|
wMenuSetEnabled(menu, i, True);
|
||||||
@@ -1368,7 +1368,7 @@ void wDockDestroy(WDock *dock)
|
|||||||
void wClipIconPaint(WAppIcon *aicon)
|
void wClipIconPaint(WAppIcon *aicon)
|
||||||
{
|
{
|
||||||
WScreen *scr = aicon->icon->core->screen_ptr;
|
WScreen *scr = aicon->icon->core->screen_ptr;
|
||||||
WWorkspace *workspace = scr->workspaces[scr->current_workspace];
|
WWorkspace *workspace = scr->workspaces[w_global.workspace.current];
|
||||||
WMColor *color;
|
WMColor *color;
|
||||||
Window win = aicon->icon->core->window;
|
Window win = aicon->icon->core->window;
|
||||||
int length, nlength;
|
int length, nlength;
|
||||||
@@ -1380,7 +1380,7 @@ void wClipIconPaint(WAppIcon *aicon)
|
|||||||
length = strlen(workspace->name);
|
length = strlen(workspace->name);
|
||||||
ws_name = wmalloc(length + 1);
|
ws_name = wmalloc(length + 1);
|
||||||
snprintf(ws_name, length + 1, "%s", workspace->name);
|
snprintf(ws_name, length + 1, "%s", workspace->name);
|
||||||
snprintf(ws_number, sizeof(ws_number), "%i", scr->current_workspace + 1);
|
snprintf(ws_number, sizeof(ws_number), "%i", w_global.workspace.current + 1);
|
||||||
nlength = strlen(ws_number);
|
nlength = strlen(ws_number);
|
||||||
|
|
||||||
if (wPreferences.flags.noclip || !workspace->clip->collapsed)
|
if (wPreferences.flags.noclip || !workspace->clip->collapsed)
|
||||||
@@ -2030,7 +2030,7 @@ static WDock *findDock(WScreen *scr, XEvent *event, int *icon_pos)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (*icon_pos < 0 && (dock = scr->workspaces[scr->current_workspace]->clip) != NULL) {
|
if (*icon_pos < 0 && (dock = scr->workspaces[w_global.workspace.current]->clip) != NULL) {
|
||||||
for (i = 0; i < dock->max_icons; i++) {
|
for (i = 0; i < dock->max_icons; i++) {
|
||||||
if (dock->icon_array[i]
|
if (dock->icon_array[i]
|
||||||
&& dock->icon_array[i]->icon->core->window == event->xclient.window) {
|
&& dock->icon_array[i]->icon->core->window == event->xclient.window) {
|
||||||
@@ -2577,7 +2577,7 @@ Bool wDockSnapIcon(WDock *dock, WAppIcon *icon, int req_x, int req_y, int *ret_x
|
|||||||
int neighbours = 0;
|
int neighbours = 0;
|
||||||
int start, stop, k;
|
int start, stop, k;
|
||||||
|
|
||||||
start = icon->omnipresent ? 0 : scr->current_workspace;
|
start = icon->omnipresent ? 0 : w_global.workspace.current;
|
||||||
stop = icon->omnipresent ? w_global.workspace.count : start + 1;
|
stop = icon->omnipresent ? w_global.workspace.count : start + 1;
|
||||||
|
|
||||||
aicon = NULL;
|
aicon = NULL;
|
||||||
@@ -2707,7 +2707,7 @@ Bool wDockFindFreeSlot(WDock *dock, int *x_pos, int *y_pos)
|
|||||||
return True;
|
return True;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dock->type == WM_CLIP && dock != scr->workspaces[scr->current_workspace]->clip)
|
if (dock->type == WM_CLIP && dock != scr->workspaces[w_global.workspace.current]->clip)
|
||||||
extra_count = scr->global_icon_count;
|
extra_count = scr->global_icon_count;
|
||||||
|
|
||||||
/* if the dock is full */
|
/* if the dock is full */
|
||||||
@@ -3064,7 +3064,7 @@ static pid_t execCommand(WAppIcon *btn, const char *command, WSavedState *state)
|
|||||||
if (btn->dock == scr->dock || btn->dock->type == WM_DRAWER || btn->omnipresent)
|
if (btn->dock == scr->dock || btn->dock->type == WM_DRAWER || btn->omnipresent)
|
||||||
state->workspace = -1;
|
state->workspace = -1;
|
||||||
else
|
else
|
||||||
state->workspace = scr->current_workspace;
|
state->workspace = w_global.workspace.current;
|
||||||
}
|
}
|
||||||
wWindowAddSavedState(btn->wm_instance, btn->wm_class, cmdline, pid, state);
|
wWindowAddSavedState(btn->wm_instance, btn->wm_class, cmdline, pid, state);
|
||||||
wAddDeathHandler(pid, (WDeathHandler *) trackDeadProcess, btn->dock);
|
wAddDeathHandler(pid, (WDeathHandler *) trackDeadProcess, btn->dock);
|
||||||
@@ -3274,8 +3274,8 @@ void wClipUpdateForWorkspaceChange(WScreen *scr, int workspace)
|
|||||||
{
|
{
|
||||||
if (!wPreferences.flags.noclip) {
|
if (!wPreferences.flags.noclip) {
|
||||||
scr->clip_icon->dock = scr->workspaces[workspace]->clip;
|
scr->clip_icon->dock = scr->workspaces[workspace]->clip;
|
||||||
if (scr->current_workspace != workspace) {
|
if (w_global.workspace.current != workspace) {
|
||||||
WDock *old_clip = scr->workspaces[scr->current_workspace]->clip;
|
WDock *old_clip = scr->workspaces[w_global.workspace.current]->clip;
|
||||||
WAppIconChain *chain = scr->global_icons;
|
WAppIconChain *chain = scr->global_icons;
|
||||||
|
|
||||||
while (chain) {
|
while (chain) {
|
||||||
@@ -3594,7 +3594,7 @@ static void iconDblClick(WObjDescriptor *desc, XEvent *event)
|
|||||||
unhideHere = (event->xbutton.state & ShiftMask);
|
unhideHere = (event->xbutton.state & ShiftMask);
|
||||||
|
|
||||||
/* go to the last workspace that the user worked on the app */
|
/* go to the last workspace that the user worked on the app */
|
||||||
if (wapp->last_workspace != dock->screen_ptr->current_workspace && !unhideHere)
|
if (wapp->last_workspace != w_global.workspace.current && !unhideHere)
|
||||||
wWorkspaceChange(dock->screen_ptr, wapp->last_workspace);
|
wWorkspaceChange(dock->screen_ptr, wapp->last_workspace);
|
||||||
|
|
||||||
wUnhideApplication(wapp, event->xbutton.button == Button2, unhideHere);
|
wUnhideApplication(wapp, event->xbutton.button == Button2, unhideHere);
|
||||||
@@ -3897,16 +3897,16 @@ static void handleClipChangeWorkspace(WScreen *scr, XEvent *event)
|
|||||||
new_ws = wPreferences.ws_advance || (event->xbutton.state & ControlMask);
|
new_ws = wPreferences.ws_advance || (event->xbutton.state & ControlMask);
|
||||||
|
|
||||||
if (direction == CLIP_FORWARD) {
|
if (direction == CLIP_FORWARD) {
|
||||||
if (scr->current_workspace < w_global.workspace.count - 1)
|
if (w_global.workspace.current < w_global.workspace.count - 1)
|
||||||
wWorkspaceChange(scr, scr->current_workspace + 1);
|
wWorkspaceChange(scr, w_global.workspace.current + 1);
|
||||||
else if (new_ws && scr->current_workspace < MAX_WORKSPACES - 1)
|
else if (new_ws && w_global.workspace.current < MAX_WORKSPACES - 1)
|
||||||
wWorkspaceChange(scr, scr->current_workspace + 1);
|
wWorkspaceChange(scr, w_global.workspace.current + 1);
|
||||||
else if (wPreferences.ws_cycle)
|
else if (wPreferences.ws_cycle)
|
||||||
wWorkspaceChange(scr, 0);
|
wWorkspaceChange(scr, 0);
|
||||||
} else if (direction == CLIP_REWIND) {
|
} else if (direction == CLIP_REWIND) {
|
||||||
if (scr->current_workspace > 0)
|
if (w_global.workspace.current > 0)
|
||||||
wWorkspaceChange(scr, scr->current_workspace - 1);
|
wWorkspaceChange(scr, w_global.workspace.current - 1);
|
||||||
else if (scr->current_workspace == 0 && wPreferences.ws_cycle)
|
else if (w_global.workspace.current == 0 && wPreferences.ws_cycle)
|
||||||
wWorkspaceChange(scr, w_global.workspace.count - 1);
|
wWorkspaceChange(scr, w_global.workspace.count - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
20
src/event.c
20
src/event.c
@@ -846,7 +846,7 @@ static void handleUnmapNotify(XEvent * event)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (!wwin->flags.mapped && !withdraw
|
if (!wwin->flags.mapped && !withdraw
|
||||||
&& wwin->frame->workspace == wwin->screen_ptr->current_workspace
|
&& wwin->frame->workspace == w_global.workspace.current
|
||||||
&& !wwin->flags.miniaturized && !wwin->flags.hidden)
|
&& !wwin->flags.miniaturized && !wwin->flags.hidden)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1566,7 +1566,7 @@ static void handleKeyPress(XEvent * event)
|
|||||||
|
|
||||||
case WKBD_WORKSPACE1 ... WKBD_WORKSPACE10:
|
case WKBD_WORKSPACE1 ... WKBD_WORKSPACE10:
|
||||||
widx = command - WKBD_WORKSPACE1;
|
widx = command - WKBD_WORKSPACE1;
|
||||||
i = (scr->current_workspace / 10) * 10 + widx;
|
i = (w_global.workspace.current / 10) * 10 + widx;
|
||||||
if (wPreferences.ws_advance || i < w_global.workspace.count)
|
if (wPreferences.ws_advance || i < w_global.workspace.count)
|
||||||
wWorkspaceChange(scr, i);
|
wWorkspaceChange(scr, i);
|
||||||
break;
|
break;
|
||||||
@@ -1583,7 +1583,7 @@ static void handleKeyPress(XEvent * event)
|
|||||||
|
|
||||||
case WKBD_MOVE_WORKSPACE1 ... WKBD_MOVE_WORKSPACE10:
|
case WKBD_MOVE_WORKSPACE1 ... WKBD_MOVE_WORKSPACE10:
|
||||||
widx = command - WKBD_MOVE_WORKSPACE1;
|
widx = command - WKBD_MOVE_WORKSPACE1;
|
||||||
i = (scr->current_workspace / 10) * 10 + widx;
|
i = (w_global.workspace.current / 10) * 10 + widx;
|
||||||
if (wwin && (wPreferences.ws_advance || i < w_global.workspace.count))
|
if (wwin && (wPreferences.ws_advance || i < w_global.workspace.count))
|
||||||
wWindowChangeWorkspace(wwin, i);
|
wWindowChangeWorkspace(wwin, i);
|
||||||
break;
|
break;
|
||||||
@@ -1607,8 +1607,8 @@ static void handleKeyPress(XEvent * event)
|
|||||||
if (wwin) {
|
if (wwin) {
|
||||||
int row, column;
|
int row, column;
|
||||||
|
|
||||||
row = scr->current_workspace / 10;
|
row = w_global.workspace.current / 10;
|
||||||
column = scr->current_workspace % 10;
|
column = w_global.workspace.current % 10;
|
||||||
|
|
||||||
if (command == WKBD_MOVE_NEXTWSLAYER) {
|
if (command == WKBD_MOVE_NEXTWSLAYER) {
|
||||||
if ((row + 1) * 10 < w_global.workspace.count)
|
if ((row + 1) * 10 < w_global.workspace.count)
|
||||||
@@ -1643,7 +1643,7 @@ static void handleKeyPress(XEvent * event)
|
|||||||
WWindow *wwin;
|
WWindow *wwin;
|
||||||
|
|
||||||
wUnselectWindows(scr);
|
wUnselectWindows(scr);
|
||||||
cw = scr->current_workspace;
|
cw = w_global.workspace.current;
|
||||||
|
|
||||||
WM_ETARETI_ARRAY(list, wwin, iter) {
|
WM_ETARETI_ARRAY(list, wwin, iter) {
|
||||||
if (count > 1)
|
if (count > 1)
|
||||||
@@ -1727,8 +1727,8 @@ static void handleKeyPress(XEvent * event)
|
|||||||
{
|
{
|
||||||
int row, column;
|
int row, column;
|
||||||
|
|
||||||
row = scr->current_workspace / 10;
|
row = w_global.workspace.current / 10;
|
||||||
column = scr->current_workspace % 10;
|
column = w_global.workspace.current % 10;
|
||||||
|
|
||||||
if (command == WKBD_NEXTWSLAYER) {
|
if (command == WKBD_NEXTWSLAYER) {
|
||||||
if ((row + 1) * 10 < w_global.workspace.count)
|
if ((row + 1) * 10 < w_global.workspace.count)
|
||||||
@@ -1741,7 +1741,7 @@ static void handleKeyPress(XEvent * event)
|
|||||||
break;
|
break;
|
||||||
case WKBD_CLIPRAISELOWER:
|
case WKBD_CLIPRAISELOWER:
|
||||||
if (!wPreferences.flags.noclip)
|
if (!wPreferences.flags.noclip)
|
||||||
wDockRaiseLower(scr->workspaces[scr->current_workspace]->clip);
|
wDockRaiseLower(scr->workspaces[w_global.workspace.current]->clip);
|
||||||
break;
|
break;
|
||||||
case WKBD_DOCKRAISELOWER:
|
case WKBD_DOCKRAISELOWER:
|
||||||
if (!wPreferences.flags.nodock)
|
if (!wPreferences.flags.nodock)
|
||||||
@@ -1754,7 +1754,7 @@ static void handleKeyPress(XEvent * event)
|
|||||||
wwin = scr->focused_window;
|
wwin = scr->focused_window;
|
||||||
|
|
||||||
if (wwin && wwin->flags.mapped
|
if (wwin && wwin->flags.mapped
|
||||||
&& wwin->frame->workspace == wwin->screen_ptr->current_workspace
|
&& wwin->frame->workspace == w_global.workspace.current
|
||||||
&& !wwin->flags.miniaturized && !wwin->flags.hidden) {
|
&& !wwin->flags.miniaturized && !wwin->flags.hidden) {
|
||||||
XkbGetState(dpy, XkbUseCoreKbd, &staterec);
|
XkbGetState(dpy, XkbUseCoreKbd, &staterec);
|
||||||
|
|
||||||
|
|||||||
@@ -587,7 +587,7 @@ char *ExpandOptions(WScreen *scr, const char *cmdline)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'W':
|
case 'W':
|
||||||
snprintf(tmpbuf, sizeof(tmpbuf), "0x%x", (unsigned int)scr->current_workspace + 1);
|
snprintf(tmpbuf, sizeof(tmpbuf), "0x%x", (unsigned int)w_global.workspace.current + 1);
|
||||||
slen = strlen(tmpbuf);
|
slen = strlen(tmpbuf);
|
||||||
olen += slen;
|
olen += slen;
|
||||||
nout = realloc(out, olen);
|
nout = realloc(out, olen);
|
||||||
|
|||||||
@@ -742,7 +742,7 @@ static void updateMoveData(WWindow * wwin, MoveData * data)
|
|||||||
data->count = 0;
|
data->count = 0;
|
||||||
tmp = scr->focused_window;
|
tmp = scr->focused_window;
|
||||||
while (tmp) {
|
while (tmp) {
|
||||||
if (tmp != wwin && scr->current_workspace == tmp->frame->workspace
|
if (tmp != wwin && w_global.workspace.current == tmp->frame->workspace
|
||||||
&& !tmp->flags.miniaturized
|
&& !tmp->flags.miniaturized
|
||||||
&& !tmp->flags.hidden && !tmp->flags.obscured && !WFLAGP(tmp, sunken)) {
|
&& !tmp->flags.hidden && !tmp->flags.obscured && !WFLAGP(tmp, sunken)) {
|
||||||
data->topList[data->count] = tmp;
|
data->topList[data->count] = tmp;
|
||||||
@@ -837,17 +837,17 @@ static Bool checkWorkspaceChange(WWindow * wwin, MoveData * data, Bool opaqueMov
|
|||||||
Bool changed = False;
|
Bool changed = False;
|
||||||
|
|
||||||
if (data->mouseX <= 1) {
|
if (data->mouseX <= 1) {
|
||||||
if (scr->current_workspace > 0) {
|
if (w_global.workspace.current > 0) {
|
||||||
crossWorkspace(scr, wwin, opaqueMove, scr->current_workspace - 1, True);
|
crossWorkspace(scr, wwin, opaqueMove, w_global.workspace.current - 1, True);
|
||||||
changed = True;
|
changed = True;
|
||||||
data->rubCount = 0;
|
data->rubCount = 0;
|
||||||
} else if (scr->current_workspace == 0 && wPreferences.ws_cycle) {
|
} else if (w_global.workspace.current == 0 && wPreferences.ws_cycle) {
|
||||||
crossWorkspace(scr, wwin, opaqueMove, w_global.workspace.count - 1, True);
|
crossWorkspace(scr, wwin, opaqueMove, w_global.workspace.count - 1, True);
|
||||||
changed = True;
|
changed = True;
|
||||||
data->rubCount = 0;
|
data->rubCount = 0;
|
||||||
}
|
}
|
||||||
} else if (data->mouseX >= scr->scr_width - 2) {
|
} else if (data->mouseX >= scr->scr_width - 2) {
|
||||||
if (scr->current_workspace == w_global.workspace.count - 1) {
|
if (w_global.workspace.current == w_global.workspace.count - 1) {
|
||||||
if (wPreferences.ws_cycle || w_global.workspace.count == MAX_WORKSPACES) {
|
if (wPreferences.ws_cycle || w_global.workspace.count == MAX_WORKSPACES) {
|
||||||
crossWorkspace(scr, wwin, opaqueMove, 0, False);
|
crossWorkspace(scr, wwin, opaqueMove, 0, False);
|
||||||
changed = True;
|
changed = True;
|
||||||
@@ -872,13 +872,13 @@ static Bool checkWorkspaceChange(WWindow * wwin, MoveData * data, Bool opaqueMov
|
|||||||
/* go to next workspace */
|
/* go to next workspace */
|
||||||
wWorkspaceNew(scr);
|
wWorkspaceNew(scr);
|
||||||
|
|
||||||
crossWorkspace(scr, wwin, opaqueMove, scr->current_workspace + 1, False);
|
crossWorkspace(scr, wwin, opaqueMove, w_global.workspace.current + 1, False);
|
||||||
changed = True;
|
changed = True;
|
||||||
data->rubCount = 0;
|
data->rubCount = 0;
|
||||||
}
|
}
|
||||||
} else if (scr->current_workspace < w_global.workspace.count) {
|
} else if (w_global.workspace.current < w_global.workspace.count) {
|
||||||
/* go to next workspace */
|
/* go to next workspace */
|
||||||
crossWorkspace(scr, wwin, opaqueMove, scr->current_workspace + 1, False);
|
crossWorkspace(scr, wwin, opaqueMove, w_global.workspace.current + 1, False);
|
||||||
changed = True;
|
changed = True;
|
||||||
data->rubCount = 0;
|
data->rubCount = 0;
|
||||||
}
|
}
|
||||||
@@ -1387,17 +1387,17 @@ int wKeyboardMoveResizeWindow(WWindow * wwin)
|
|||||||
|
|
||||||
if (wPreferences.ws_cycle) {
|
if (wPreferences.ws_cycle) {
|
||||||
if (src_x + off_x + ww < 20) {
|
if (src_x + off_x + ww < 20) {
|
||||||
if (!scr->current_workspace)
|
if (!w_global.workspace.current)
|
||||||
wWorkspaceChange(scr, w_global.workspace.count - 1);
|
wWorkspaceChange(scr, w_global.workspace.count - 1);
|
||||||
else
|
else
|
||||||
wWorkspaceChange(scr, scr->current_workspace - 1);
|
wWorkspaceChange(scr, w_global.workspace.current - 1);
|
||||||
|
|
||||||
off_x += scr_width;
|
off_x += scr_width;
|
||||||
} else if (src_x + off_x + 20 > scr_width) {
|
} else if (src_x + off_x + 20 > scr_width) {
|
||||||
if (scr->current_workspace == w_global.workspace.count - 1)
|
if (w_global.workspace.current == w_global.workspace.count - 1)
|
||||||
wWorkspaceChange(scr, 0);
|
wWorkspaceChange(scr, 0);
|
||||||
else
|
else
|
||||||
wWorkspaceChange(scr, scr->current_workspace + 1);
|
wWorkspaceChange(scr, w_global.workspace.current + 1);
|
||||||
|
|
||||||
off_x -= scr_width;
|
off_x -= scr_width;
|
||||||
}
|
}
|
||||||
@@ -1520,7 +1520,7 @@ int wKeyboardMoveResizeWindow(WWindow * wwin)
|
|||||||
wWindowConfigure(wwin, src_x + off_x, src_y + off_y, ww, wh - vert_border);
|
wWindowConfigure(wwin, src_x + off_x, src_y + off_y, ww, wh - vert_border);
|
||||||
wWindowSynthConfigureNotify(wwin);
|
wWindowSynthConfigureNotify(wwin);
|
||||||
}
|
}
|
||||||
wWindowChangeWorkspace(wwin, scr->current_workspace);
|
wWindowChangeWorkspace(wwin, w_global.workspace.current);
|
||||||
wSetFocusTo(scr, wwin);
|
wSetFocusTo(scr, wwin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1653,7 +1653,7 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev)
|
|||||||
opaqueMove, event.xmotion.x_root, event.xmotion.y_root);
|
opaqueMove, event.xmotion.x_root, event.xmotion.y_root);
|
||||||
|
|
||||||
if (!warped && !wPreferences.no_autowrap) {
|
if (!warped && !wPreferences.no_autowrap) {
|
||||||
int oldWorkspace = scr->current_workspace;
|
int oldWorkspace = w_global.workspace.current;
|
||||||
|
|
||||||
if (wPreferences.move_display == WDIS_NEW && !scr->selected_windows) {
|
if (wPreferences.move_display == WDIS_NEW && !scr->selected_windows) {
|
||||||
showPosition(wwin, moveData.realX, moveData.realY);
|
showPosition(wwin, moveData.realX, moveData.realY);
|
||||||
@@ -1665,7 +1665,7 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev)
|
|||||||
moveData.realY - wwin->frame_y);
|
moveData.realY - wwin->frame_y);
|
||||||
}
|
}
|
||||||
if (checkWorkspaceChange(wwin, &moveData, opaqueMove)) {
|
if (checkWorkspaceChange(wwin, &moveData, opaqueMove)) {
|
||||||
if (scr->current_workspace != oldWorkspace
|
if (w_global.workspace.current != oldWorkspace
|
||||||
&& wPreferences.edge_resistance > 0
|
&& wPreferences.edge_resistance > 0
|
||||||
&& scr->selected_windows == NULL)
|
&& scr->selected_windows == NULL)
|
||||||
updateMoveData(wwin, &moveData);
|
updateMoveData(wwin, &moveData);
|
||||||
@@ -1732,7 +1732,7 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev)
|
|||||||
XUngrabKeyboard(dpy, CurrentTime);
|
XUngrabKeyboard(dpy, CurrentTime);
|
||||||
XUngrabServer(dpy);
|
XUngrabServer(dpy);
|
||||||
if (!opaqueMove) {
|
if (!opaqueMove) {
|
||||||
wWindowChangeWorkspace(wwin, scr->current_workspace);
|
wWindowChangeWorkspace(wwin, w_global.workspace.current);
|
||||||
wSetFocusTo(scr, wwin);
|
wSetFocusTo(scr, wwin);
|
||||||
}
|
}
|
||||||
if (wPreferences.move_display == WDIS_NEW)
|
if (wPreferences.move_display == WDIS_NEW)
|
||||||
@@ -2123,7 +2123,7 @@ static void selectWindowsInside(WScreen * scr, int x1, int y1, int x2, int y2)
|
|||||||
tmpw = scr->focused_window;
|
tmpw = scr->focused_window;
|
||||||
while (tmpw != NULL) {
|
while (tmpw != NULL) {
|
||||||
if (!(tmpw->flags.miniaturized || tmpw->flags.hidden)) {
|
if (!(tmpw->flags.miniaturized || tmpw->flags.hidden)) {
|
||||||
if ((tmpw->frame->workspace == scr->current_workspace || IS_OMNIPRESENT(tmpw))
|
if ((tmpw->frame->workspace == w_global.workspace.current || IS_OMNIPRESENT(tmpw))
|
||||||
&& (tmpw->frame_x >= x1) && (tmpw->frame_y >= y1)
|
&& (tmpw->frame_x >= x1) && (tmpw->frame_y >= y1)
|
||||||
&& (tmpw->frame->core->width + tmpw->frame_x <= x2)
|
&& (tmpw->frame->core->width + tmpw->frame_x <= x2)
|
||||||
&& (tmpw->frame->core->height + tmpw->frame_y <= y2)) {
|
&& (tmpw->frame->core->height + tmpw->frame_y <= y2)) {
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int head)
|
|||||||
while (obj) {
|
while (obj) {
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
if (iconPosition(obj, sx1, sy1, sx2, sy2, scr->current_workspace, &x, &y)) {
|
if (iconPosition(obj, sx1, sy1, sx2, sy2, w_global.workspace.current, &x, &y)) {
|
||||||
int xdi, ydi; /* rounded down */
|
int xdi, ydi; /* rounded down */
|
||||||
int xui, yui; /* rounded up */
|
int xui, yui; /* rounded up */
|
||||||
|
|
||||||
@@ -269,7 +269,7 @@ static int calcSumOfCoveredAreas(WWindow *wwin, int x, int y, int w, int h)
|
|||||||
ty = test_window->frame_y;
|
ty = test_window->frame_y;
|
||||||
|
|
||||||
if (test_window->flags.mapped || (test_window->flags.shaded &&
|
if (test_window->flags.mapped || (test_window->flags.shaded &&
|
||||||
test_window->frame->workspace == wwin->screen_ptr->current_workspace &&
|
test_window->frame->workspace == w_global.workspace.current &&
|
||||||
!(test_window->flags.miniaturized || test_window->flags.hidden))) {
|
!(test_window->flags.miniaturized || test_window->flags.hidden))) {
|
||||||
sum_isect += calcIntersectionArea(tx, ty, tw, th, x, y, w, h);
|
sum_isect += calcIntersectionArea(tx, ty, tw, th, x, y, w, h);
|
||||||
}
|
}
|
||||||
@@ -413,7 +413,7 @@ autoPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
|
|||||||
(ty < (test_y + height)) && ((ty + th) > test_y) &&
|
(ty < (test_y + height)) && ((ty + th) > test_y) &&
|
||||||
(test_window->flags.mapped ||
|
(test_window->flags.mapped ||
|
||||||
(test_window->flags.shaded &&
|
(test_window->flags.shaded &&
|
||||||
test_window->frame->workspace == scr->current_workspace &&
|
test_window->frame->workspace == w_global.workspace.current &&
|
||||||
!(test_window->flags.miniaturized || test_window->flags.hidden)))) {
|
!(test_window->flags.miniaturized || test_window->flags.hidden)))) {
|
||||||
|
|
||||||
loc_ok = False;
|
loc_ok = False;
|
||||||
@@ -439,7 +439,7 @@ autoPlaceWindow(WWindow *wwin, int *x_ret, int *y_ret,
|
|||||||
(ty < (test_y + height)) && ((ty + th) > test_y) &&
|
(ty < (test_y + height)) && ((ty + th) > test_y) &&
|
||||||
(test_window->flags.mapped ||
|
(test_window->flags.mapped ||
|
||||||
(test_window->flags.shaded &&
|
(test_window->flags.shaded &&
|
||||||
test_window->frame->workspace == scr->current_workspace &&
|
test_window->frame->workspace == w_global.workspace.current &&
|
||||||
!(test_window->flags.miniaturized || test_window->flags.hidden)))) {
|
!(test_window->flags.miniaturized || test_window->flags.hidden)))) {
|
||||||
|
|
||||||
loc_ok = False;
|
loc_ok = False;
|
||||||
|
|||||||
@@ -123,8 +123,6 @@ typedef struct _WScreen {
|
|||||||
|
|
||||||
struct WWorkspace **workspaces; /* workspace array */
|
struct WWorkspace **workspaces; /* workspace array */
|
||||||
|
|
||||||
int current_workspace; /* current workspace number */
|
|
||||||
|
|
||||||
WReservedArea *reservedAreas; /* used to build totalUsableArea */
|
WReservedArea *reservedAreas; /* used to build totalUsableArea */
|
||||||
|
|
||||||
WArea *usableArea; /* area of the workspace where
|
WArea *usableArea; /* area of the workspace where
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ void wSessionSaveState(WScreen * scr)
|
|||||||
WMPutInPLDictionary(scr->session_state, sApplications, list);
|
WMPutInPLDictionary(scr->session_state, sApplications, list);
|
||||||
WMReleasePropList(list);
|
WMReleasePropList(list);
|
||||||
|
|
||||||
wks = WMCreatePLString(scr->workspaces[scr->current_workspace]->name);
|
wks = WMCreatePLString(scr->workspaces[w_global.workspace.current]->name);
|
||||||
WMPutInPLDictionary(scr->session_state, sWorkspace, wks);
|
WMPutInPLDictionary(scr->session_state, sWorkspace, wks);
|
||||||
WMReleasePropList(wks);
|
WMReleasePropList(wks);
|
||||||
|
|
||||||
@@ -556,6 +556,6 @@ void wSessionRestoreLastWorkspace(WScreen * scr)
|
|||||||
/* Get the workspace number for the workspace name */
|
/* Get the workspace number for the workspace name */
|
||||||
w = wGetWorkspaceNumber(scr, value);
|
w = wGetWorkspaceNumber(scr, value);
|
||||||
|
|
||||||
if (w != scr->current_workspace && w < w_global.workspace.count)
|
if (w != w_global.workspace.current && w < w_global.workspace.count)
|
||||||
wWorkspaceChange(scr, w);
|
wWorkspaceChange(scr, w);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -876,6 +876,6 @@ static void manageAllWindows(WScreen * scr, int crashRecovery)
|
|||||||
w_global.workspace.last_used = 0;
|
w_global.workspace.last_used = 0;
|
||||||
wWorkspaceForceChange(scr, 0);
|
wWorkspaceForceChange(scr, 0);
|
||||||
if (!wPreferences.flags.noclip)
|
if (!wPreferences.flags.noclip)
|
||||||
wDockShowIcons(scr->workspaces[scr->current_workspace]->clip);
|
wDockShowIcons(scr->workspaces[w_global.workspace.current]->clip);
|
||||||
scr->flags.startup2 = 0;
|
scr->flags.startup2 = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ struct SwitchPanel {
|
|||||||
|
|
||||||
static int canReceiveFocus(WWindow *wwin)
|
static int canReceiveFocus(WWindow *wwin)
|
||||||
{
|
{
|
||||||
if (wwin->frame->workspace != wwin->screen_ptr->current_workspace)
|
if (wwin->frame->workspace != w_global.workspace.current)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (wPreferences.cycle_active_head_only &&
|
if (wPreferences.cycle_active_head_only &&
|
||||||
|
|||||||
18
src/window.c
18
src/window.c
@@ -844,12 +844,12 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
|||||||
if (w < 0 || w >= w_global.workspace.count) {
|
if (w < 0 || w >= w_global.workspace.count) {
|
||||||
workspace = win_state->state->workspace;
|
workspace = win_state->state->workspace;
|
||||||
if (workspace >= w_global.workspace.count)
|
if (workspace >= w_global.workspace.count)
|
||||||
workspace = scr->current_workspace;
|
workspace = w_global.workspace.current;
|
||||||
} else {
|
} else {
|
||||||
workspace = w;
|
workspace = w;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
workspace = scr->current_workspace;
|
workspace = w_global.workspace.current;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -925,7 +925,7 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
|||||||
if (wPreferences.open_transients_with_parent && transientOwner)
|
if (wPreferences.open_transients_with_parent && transientOwner)
|
||||||
workspace = transientOwner->frame->workspace;
|
workspace = transientOwner->frame->workspace;
|
||||||
else
|
else
|
||||||
workspace = scr->current_workspace;
|
workspace = w_global.workspace.current;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -949,7 +949,7 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
|||||||
y = win_state->state->y;
|
y = win_state->state->y;
|
||||||
} else if ((wwin->transient_for == None || wPreferences.window_placement != WPM_MANUAL)
|
} else if ((wwin->transient_for == None || wPreferences.window_placement != WPM_MANUAL)
|
||||||
&& !scr->flags.startup
|
&& !scr->flags.startup
|
||||||
&& workspace == scr->current_workspace
|
&& workspace == w_global.workspace.current
|
||||||
&& !wwin->flags.miniaturized
|
&& !wwin->flags.miniaturized
|
||||||
&& !wwin->flags.maximized && !(wwin->normal_hints->flags & (USPosition | PPosition))) {
|
&& !wwin->flags.maximized && !(wwin->normal_hints->flags & (USPosition | PPosition))) {
|
||||||
|
|
||||||
@@ -1188,7 +1188,7 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
|||||||
XLowerWindow(dpy, window);
|
XLowerWindow(dpy, window);
|
||||||
|
|
||||||
/* if window is in this workspace and should be mapped, then map it */
|
/* if window is in this workspace and should be mapped, then map it */
|
||||||
if (!wwin->flags.miniaturized && (workspace == scr->current_workspace || IS_OMNIPRESENT(wwin))
|
if (!wwin->flags.miniaturized && (workspace == w_global.workspace.current || IS_OMNIPRESENT(wwin))
|
||||||
&& !wwin->flags.hidden && !withdraw) {
|
&& !wwin->flags.hidden && !withdraw) {
|
||||||
|
|
||||||
/* The following "if" is to avoid crashing of clients that expect
|
/* The following "if" is to avoid crashing of clients that expect
|
||||||
@@ -1262,7 +1262,7 @@ WWindow *wManageWindow(WScreen *scr, Window window)
|
|||||||
/* Final preparations before window is ready to go */
|
/* Final preparations before window is ready to go */
|
||||||
wFrameWindowChangeState(wwin->frame, WS_UNFOCUSED);
|
wFrameWindowChangeState(wwin->frame, WS_UNFOCUSED);
|
||||||
|
|
||||||
if (!wwin->flags.miniaturized && workspace == scr->current_workspace && !wwin->flags.hidden) {
|
if (!wwin->flags.miniaturized && workspace == w_global.workspace.current && !wwin->flags.hidden) {
|
||||||
if (((transientOwner && transientOwner->flags.focused)
|
if (((transientOwner && transientOwner->flags.focused)
|
||||||
|| wPreferences.auto_focus) && !WFLAGP(wwin, no_focusable)) {
|
|| wPreferences.auto_focus) && !WFLAGP(wwin, no_focusable)) {
|
||||||
|
|
||||||
@@ -1371,7 +1371,7 @@ WWindow *wManageInternalWindow(WScreen *scr, Window window, Window owner,
|
|||||||
wFrameWindowHideButton(wwin->frame, WFF_RIGHT_BUTTON);
|
wFrameWindowHideButton(wwin->frame, WFF_RIGHT_BUTTON);
|
||||||
|
|
||||||
wwin->frame->child = wwin;
|
wwin->frame->child = wwin;
|
||||||
wwin->frame->workspace = wwin->screen_ptr->current_workspace;
|
wwin->frame->workspace = w_global.workspace.current;
|
||||||
|
|
||||||
#ifdef XKB_BUTTON_HINT
|
#ifdef XKB_BUTTON_HINT
|
||||||
if (wPreferences.modelock)
|
if (wPreferences.modelock)
|
||||||
@@ -1869,7 +1869,7 @@ void wWindowChangeWorkspace(WWindow *wwin, int workspace)
|
|||||||
if (workspace >= w_global.workspace.count || workspace < 0 || workspace == wwin->frame->workspace)
|
if (workspace >= w_global.workspace.count || workspace < 0 || workspace == wwin->frame->workspace)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (workspace != scr->current_workspace) {
|
if (workspace != w_global.workspace.current) {
|
||||||
/* Sent to other workspace. Unmap window */
|
/* Sent to other workspace. Unmap window */
|
||||||
if ((wwin->flags.mapped
|
if ((wwin->flags.mapped
|
||||||
|| wwin->flags.shaded || (wwin->flags.miniaturized && !wPreferences.sticky_icons))
|
|| wwin->flags.shaded || (wwin->flags.miniaturized && !wPreferences.sticky_icons))
|
||||||
@@ -1913,7 +1913,7 @@ void wWindowChangeWorkspace(WWindow *wwin, int workspace)
|
|||||||
void wWindowChangeWorkspaceRelative(WWindow *wwin, int amount)
|
void wWindowChangeWorkspaceRelative(WWindow *wwin, int amount)
|
||||||
{
|
{
|
||||||
WScreen *scr = wwin->screen_ptr;
|
WScreen *scr = wwin->screen_ptr;
|
||||||
int w = scr->current_workspace + amount;
|
int w = w_global.workspace.current + amount;
|
||||||
|
|
||||||
if (amount < 0) {
|
if (amount < 0) {
|
||||||
if (w >= 0) {
|
if (w >= 0) {
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ static void updateWorkspaceMenu(WMenu * menu)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* workspace shortcut labels */
|
/* workspace shortcut labels */
|
||||||
if (i / 10 == scr->current_workspace / 10)
|
if (i / 10 == w_global.workspace.current / 10)
|
||||||
entry->rtext = GetShortcutKey(wKeyBindings[WKBD_MOVE_WORKSPACE1 + (i % 10)]);
|
entry->rtext = GetShortcutKey(wKeyBindings[WKBD_MOVE_WORKSPACE1 + (i % 10)]);
|
||||||
else
|
else
|
||||||
entry->rtext = NULL;
|
entry->rtext = NULL;
|
||||||
@@ -571,7 +571,7 @@ static void updateMenuForWindow(WMenu * menu, WWindow * wwin)
|
|||||||
|
|
||||||
for (i = 0; i < scr->workspace_submenu->entry_no; i++) {
|
for (i = 0; i < scr->workspace_submenu->entry_no; i++) {
|
||||||
scr->workspace_submenu->entries[i]->clientdata = wwin;
|
scr->workspace_submenu->entries[i]->clientdata = wwin;
|
||||||
if (i == scr->current_workspace)
|
if (i == w_global.workspace.current)
|
||||||
wMenuSetEnabled(scr->workspace_submenu, i, False);
|
wMenuSetEnabled(scr->workspace_submenu, i, False);
|
||||||
else
|
else
|
||||||
wMenuSetEnabled(scr->workspace_submenu, i, True);
|
wMenuSetEnabled(scr->workspace_submenu, i, True);
|
||||||
|
|||||||
@@ -509,13 +509,13 @@ static void wNETWMShowingDesktop(WScreen *scr, Bool show)
|
|||||||
updateShowDesktop(scr, True);
|
updateShowDesktop(scr, True);
|
||||||
} else if (scr->netdata->show_desktop != NULL) {
|
} else if (scr->netdata->show_desktop != NULL) {
|
||||||
/* FIXME: get rid of workspace flashing ! */
|
/* FIXME: get rid of workspace flashing ! */
|
||||||
int ws = scr->current_workspace;
|
int ws = w_global.workspace.current;
|
||||||
WWindow **tmp;
|
WWindow **tmp;
|
||||||
for (tmp = scr->netdata->show_desktop; *tmp; ++tmp) {
|
for (tmp = scr->netdata->show_desktop; *tmp; ++tmp) {
|
||||||
wDeiconifyWindow(*tmp);
|
wDeiconifyWindow(*tmp);
|
||||||
(*tmp)->flags.net_show_desktop = 0;
|
(*tmp)->flags.net_show_desktop = 0;
|
||||||
}
|
}
|
||||||
if (ws != scr->current_workspace)
|
if (ws != w_global.workspace.current)
|
||||||
wWorkspaceChange(scr, ws);
|
wWorkspaceChange(scr, ws);
|
||||||
wfree(scr->netdata->show_desktop);
|
wfree(scr->netdata->show_desktop);
|
||||||
scr->netdata->show_desktop = NULL;
|
scr->netdata->show_desktop = NULL;
|
||||||
@@ -746,7 +746,7 @@ static void updateCurrentWorkspace(WScreen *scr)
|
|||||||
{ /* changeable */
|
{ /* changeable */
|
||||||
long count;
|
long count;
|
||||||
|
|
||||||
count = scr->current_workspace;
|
count = w_global.workspace.current;
|
||||||
|
|
||||||
XChangeProperty(dpy, scr->root_win, net_current_desktop, XA_CARDINAL, 32,
|
XChangeProperty(dpy, scr->root_win, net_current_desktop, XA_CARDINAL, 32,
|
||||||
PropModeReplace, (unsigned char *)&count, 1);
|
PropModeReplace, (unsigned char *)&count, 1);
|
||||||
@@ -1394,7 +1394,7 @@ Bool wNETWMProcessClientMessage(XClientMessageEvent *event)
|
|||||||
* - giving the client the focus does not cause a change in
|
* - giving the client the focus does not cause a change in
|
||||||
* the active workspace (XXX: or the active head if Xinerama)
|
* the active workspace (XXX: or the active head if Xinerama)
|
||||||
*/
|
*/
|
||||||
if (wwin->frame->workspace == wwin->screen_ptr->current_workspace /* No workspace change */
|
if (wwin->frame->workspace == w_global.workspace.current /* No workspace change */
|
||||||
|| event->data.l[0] == 2 /* Requested by pager */
|
|| event->data.l[0] == 2 /* Requested by pager */
|
||||||
|| WFLAGP(wwin, focus_across_wksp) /* Explicitly allowed */) {
|
|| WFLAGP(wwin, focus_across_wksp) /* Explicitly allowed */) {
|
||||||
wNETWMShowingDesktop(scr, False);
|
wNETWMShowingDesktop(scr, False);
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ Bool wWorkspaceDelete(WScreen * scr, int workspace)
|
|||||||
wNETWMUpdateDesktop(scr);
|
wNETWMUpdateDesktop(scr);
|
||||||
WMPostNotificationName(WMNWorkspaceDestroyed, scr, (void *)(uintptr_t) (w_global.workspace.count - 1));
|
WMPostNotificationName(WMNWorkspaceDestroyed, scr, (void *)(uintptr_t) (w_global.workspace.count - 1));
|
||||||
|
|
||||||
if (scr->current_workspace >= w_global.workspace.count)
|
if (w_global.workspace.current >= w_global.workspace.count)
|
||||||
wWorkspaceChange(scr, w_global.workspace.count - 1);
|
wWorkspaceChange(scr, w_global.workspace.count - 1);
|
||||||
if (w_global.workspace.last_used >= w_global.workspace.count)
|
if (w_global.workspace.last_used >= w_global.workspace.count)
|
||||||
w_global.workspace.last_used = 0;
|
w_global.workspace.last_used = 0;
|
||||||
@@ -429,7 +429,7 @@ void wWorkspaceChange(WScreen *scr, int workspace)
|
|||||||
if (scr->flags.startup || scr->flags.startup2 || scr->flags.ignore_focus_events)
|
if (scr->flags.startup || scr->flags.startup2 || scr->flags.ignore_focus_events)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (workspace != scr->current_workspace)
|
if (workspace != w_global.workspace.current)
|
||||||
wWorkspaceForceChange(scr, workspace);
|
wWorkspaceForceChange(scr, workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -444,7 +444,7 @@ void wWorkspaceRelativeChange(WScreen * scr, int amount)
|
|||||||
if (ignore_wks_change)
|
if (ignore_wks_change)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
w = scr->current_workspace + amount;
|
w = w_global.workspace.current + amount;
|
||||||
|
|
||||||
if (amount < 0) {
|
if (amount < 0) {
|
||||||
if (w >= 0) {
|
if (w >= 0) {
|
||||||
@@ -479,8 +479,8 @@ void wWorkspaceForceChange(WScreen * scr, int workspace)
|
|||||||
|
|
||||||
wClipUpdateForWorkspaceChange(scr, workspace);
|
wClipUpdateForWorkspaceChange(scr, workspace);
|
||||||
|
|
||||||
w_global.workspace.last_used = scr->current_workspace;
|
w_global.workspace.last_used = w_global.workspace.current;
|
||||||
scr->current_workspace = workspace;
|
w_global.workspace.current = workspace;
|
||||||
|
|
||||||
wWorkspaceMenuUpdate(scr, scr->workspace_menu);
|
wWorkspaceMenuUpdate(scr, scr->workspace_menu);
|
||||||
|
|
||||||
@@ -770,24 +770,24 @@ void wWorkspaceMenuUpdate(WScreen * scr, WMenu * menu)
|
|||||||
|
|
||||||
for (i = 0; i < w_global.workspace.count; i++) {
|
for (i = 0; i < w_global.workspace.count; i++) {
|
||||||
/* workspace shortcut labels */
|
/* workspace shortcut labels */
|
||||||
if (i / 10 == scr->current_workspace / 10)
|
if (i / 10 == w_global.workspace.current / 10)
|
||||||
menu->entries[i + MC_WORKSPACE1]->rtext = GetShortcutKey(wKeyBindings[WKBD_WORKSPACE1 + (i % 10)]);
|
menu->entries[i + MC_WORKSPACE1]->rtext = GetShortcutKey(wKeyBindings[WKBD_WORKSPACE1 + (i % 10)]);
|
||||||
else
|
else
|
||||||
menu->entries[i + MC_WORKSPACE1]->rtext = NULL;
|
menu->entries[i + MC_WORKSPACE1]->rtext = NULL;
|
||||||
|
|
||||||
menu->entries[i + MC_WORKSPACE1]->flags.indicator_on = 0;
|
menu->entries[i + MC_WORKSPACE1]->flags.indicator_on = 0;
|
||||||
}
|
}
|
||||||
menu->entries[scr->current_workspace + MC_WORKSPACE1]->flags.indicator_on = 1;
|
menu->entries[w_global.workspace.current + MC_WORKSPACE1]->flags.indicator_on = 1;
|
||||||
wMenuRealize(menu);
|
wMenuRealize(menu);
|
||||||
|
|
||||||
/* don't let user destroy current workspace */
|
/* don't let user destroy current workspace */
|
||||||
if (scr->current_workspace == w_global.workspace.count - 1)
|
if (w_global.workspace.current == w_global.workspace.count - 1)
|
||||||
wMenuSetEnabled(menu, MC_DESTROY_LAST, False);
|
wMenuSetEnabled(menu, MC_DESTROY_LAST, False);
|
||||||
else
|
else
|
||||||
wMenuSetEnabled(menu, MC_DESTROY_LAST, True);
|
wMenuSetEnabled(menu, MC_DESTROY_LAST, True);
|
||||||
|
|
||||||
/* back to last workspace */
|
/* back to last workspace */
|
||||||
if (w_global.workspace.count && w_global.workspace.last_used != scr->current_workspace)
|
if (w_global.workspace.count && w_global.workspace.last_used != w_global.workspace.current)
|
||||||
wMenuSetEnabled(menu, MC_LAST_USED, True);
|
wMenuSetEnabled(menu, MC_LAST_USED, True);
|
||||||
else
|
else
|
||||||
wMenuSetEnabled(menu, MC_LAST_USED, False);
|
wMenuSetEnabled(menu, MC_LAST_USED, False);
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ Bool acceptXDND(Window window)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (icon_pos < 0 && (dock = scr->workspaces[scr->current_workspace]->clip) != NULL) {
|
if (icon_pos < 0 && (dock = scr->workspaces[w_global.workspace.current]->clip) != NULL) {
|
||||||
for (i = 0; i < dock->max_icons; i++) {
|
for (i = 0; i < dock->max_icons; i++) {
|
||||||
if (dock->icon_array[i]
|
if (dock->icon_array[i]
|
||||||
&& dock->icon_array[i]->icon->core->window == window) {
|
&& dock->icon_array[i]->icon->core->window == window) {
|
||||||
|
|||||||
Reference in New Issue
Block a user