mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 05:48:01 +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
@@ -742,7 +742,7 @@ static void updateMoveData(WWindow * wwin, MoveData * data)
|
||||
data->count = 0;
|
||||
tmp = scr->focused_window;
|
||||
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.hidden && !tmp->flags.obscured && !WFLAGP(tmp, sunken)) {
|
||||
data->topList[data->count] = tmp;
|
||||
@@ -837,17 +837,17 @@ static Bool checkWorkspaceChange(WWindow * wwin, MoveData * data, Bool opaqueMov
|
||||
Bool changed = False;
|
||||
|
||||
if (data->mouseX <= 1) {
|
||||
if (scr->current_workspace > 0) {
|
||||
crossWorkspace(scr, wwin, opaqueMove, scr->current_workspace - 1, True);
|
||||
if (w_global.workspace.current > 0) {
|
||||
crossWorkspace(scr, wwin, opaqueMove, w_global.workspace.current - 1, True);
|
||||
changed = True;
|
||||
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);
|
||||
changed = True;
|
||||
data->rubCount = 0;
|
||||
}
|
||||
} 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) {
|
||||
crossWorkspace(scr, wwin, opaqueMove, 0, False);
|
||||
changed = True;
|
||||
@@ -872,13 +872,13 @@ static Bool checkWorkspaceChange(WWindow * wwin, MoveData * data, Bool opaqueMov
|
||||
/* go to next workspace */
|
||||
wWorkspaceNew(scr);
|
||||
|
||||
crossWorkspace(scr, wwin, opaqueMove, scr->current_workspace + 1, False);
|
||||
crossWorkspace(scr, wwin, opaqueMove, w_global.workspace.current + 1, False);
|
||||
changed = True;
|
||||
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 */
|
||||
crossWorkspace(scr, wwin, opaqueMove, scr->current_workspace + 1, False);
|
||||
crossWorkspace(scr, wwin, opaqueMove, w_global.workspace.current + 1, False);
|
||||
changed = True;
|
||||
data->rubCount = 0;
|
||||
}
|
||||
@@ -1387,17 +1387,17 @@ int wKeyboardMoveResizeWindow(WWindow * wwin)
|
||||
|
||||
if (wPreferences.ws_cycle) {
|
||||
if (src_x + off_x + ww < 20) {
|
||||
if (!scr->current_workspace)
|
||||
if (!w_global.workspace.current)
|
||||
wWorkspaceChange(scr, w_global.workspace.count - 1);
|
||||
else
|
||||
wWorkspaceChange(scr, scr->current_workspace - 1);
|
||||
wWorkspaceChange(scr, w_global.workspace.current - 1);
|
||||
|
||||
off_x += 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);
|
||||
else
|
||||
wWorkspaceChange(scr, scr->current_workspace + 1);
|
||||
wWorkspaceChange(scr, w_global.workspace.current + 1);
|
||||
|
||||
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);
|
||||
wWindowSynthConfigureNotify(wwin);
|
||||
}
|
||||
wWindowChangeWorkspace(wwin, scr->current_workspace);
|
||||
wWindowChangeWorkspace(wwin, w_global.workspace.current);
|
||||
wSetFocusTo(scr, wwin);
|
||||
}
|
||||
|
||||
@@ -1653,7 +1653,7 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev)
|
||||
opaqueMove, event.xmotion.x_root, event.xmotion.y_root);
|
||||
|
||||
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) {
|
||||
showPosition(wwin, moveData.realX, moveData.realY);
|
||||
@@ -1665,7 +1665,7 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev)
|
||||
moveData.realY - wwin->frame_y);
|
||||
}
|
||||
if (checkWorkspaceChange(wwin, &moveData, opaqueMove)) {
|
||||
if (scr->current_workspace != oldWorkspace
|
||||
if (w_global.workspace.current != oldWorkspace
|
||||
&& wPreferences.edge_resistance > 0
|
||||
&& scr->selected_windows == NULL)
|
||||
updateMoveData(wwin, &moveData);
|
||||
@@ -1732,7 +1732,7 @@ int wMouseMoveWindow(WWindow * wwin, XEvent * ev)
|
||||
XUngrabKeyboard(dpy, CurrentTime);
|
||||
XUngrabServer(dpy);
|
||||
if (!opaqueMove) {
|
||||
wWindowChangeWorkspace(wwin, scr->current_workspace);
|
||||
wWindowChangeWorkspace(wwin, w_global.workspace.current);
|
||||
wSetFocusTo(scr, wwin);
|
||||
}
|
||||
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;
|
||||
while (tmpw != NULL) {
|
||||
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->core->width + tmpw->frame_x <= x2)
|
||||
&& (tmpw->frame->core->height + tmpw->frame_y <= y2)) {
|
||||
|
||||
Reference in New Issue
Block a user