mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
wmaker: code style
This patch removes some extra curly brackets, some empty lines, extra spaces, ... to follow wmaker's coding style
This commit is contained in:
committed by
Carlos R. Mafra
parent
29ccfbbf20
commit
4ac65ab260
@@ -1624,9 +1624,9 @@ 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 != scr->current_workspace)
|
||||||
wWindowChangeWorkspace(wlist, scr->current_workspace);
|
wWindowChangeWorkspace(wlist, scr->current_workspace);
|
||||||
}
|
|
||||||
wRaiseFrame(wlist->frame->core);
|
wRaiseFrame(wlist->frame->core);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1871,9 +1871,9 @@ void wMakeWindowVisible(WWindow *wwin)
|
|||||||
if (wwin->frame->workspace != wwin->screen_ptr->current_workspace)
|
if (wwin->frame->workspace != wwin->screen_ptr->current_workspace)
|
||||||
wWorkspaceChange(wwin->screen_ptr, wwin->frame->workspace);
|
wWorkspaceChange(wwin->screen_ptr, wwin->frame->workspace);
|
||||||
|
|
||||||
if (wwin->flags.shaded) {
|
if (wwin->flags.shaded)
|
||||||
wUnshadeWindow(wwin);
|
wUnshadeWindow(wwin);
|
||||||
}
|
|
||||||
if (wwin->flags.hidden) {
|
if (wwin->flags.hidden) {
|
||||||
WApplication *app;
|
WApplication *app;
|
||||||
|
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ void wAppIconMove(WAppIcon * aicon, int x, int y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WS_INDICATOR
|
#ifdef WS_INDICATOR
|
||||||
static void updateDockNumbers(WScreen * scr)
|
static void updateDockNumbers(WScreen *scr)
|
||||||
{
|
{
|
||||||
int length;
|
int length;
|
||||||
char *ws_numbers;
|
char *ws_numbers;
|
||||||
@@ -807,9 +807,11 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event)
|
|||||||
}
|
}
|
||||||
if (!wPreferences.flags.nodock && scr->dock != originalDock)
|
if (!wPreferences.flags.nodock && scr->dock != originalDock)
|
||||||
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[scr->current_workspace]->clip)
|
||||||
allDocks[ i++ ] = scr->workspaces[scr->current_workspace]->clip;
|
allDocks[ i++ ] = scr->workspaces[scr->current_workspace]->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,6 +864,7 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event)
|
|||||||
for (i = 0; i < scr->workspace_count; i++) {
|
for (i = 0; i < scr->workspace_count; i++) {
|
||||||
if (i == scr->current_workspace)
|
if (i == scr->current_workspace)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
wDockShowIcons(scr->workspaces[i]->clip);
|
wDockShowIcons(scr->workspaces[i]->clip);
|
||||||
/* Note: if dock is collapsed (for instance, because it
|
/* Note: if dock is collapsed (for instance, because it
|
||||||
auto-collapses), its icons still won't show up */
|
auto-collapses), its icons still won't show up */
|
||||||
@@ -1067,6 +1070,7 @@ Bool wHandleAppIconMove(WAppIcon *aicon, XEvent *event)
|
|||||||
for (i = 0; i < scr->workspace_count; i++) {
|
for (i = 0; i < scr->workspace_count; i++) {
|
||||||
if (i == scr->current_workspace)
|
if (i == scr->current_workspace)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
wDockHideIcons(scr->workspaces[i]->clip);
|
wDockHideIcons(scr->workspaces[i]->clip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1148,8 +1152,10 @@ static void create_appicon_from_dock(WWindow *wwin, WApplication *wapp, Window m
|
|||||||
int i;
|
int i;
|
||||||
for (i = 0; i < scr->workspace_count; i++) {
|
for (i = 0; i < scr->workspace_count; i++) {
|
||||||
WDock *dock = scr->workspaces[i]->clip;
|
WDock *dock = scr->workspaces[i]->clip;
|
||||||
|
|
||||||
if (dock)
|
if (dock)
|
||||||
wapp->app_icon = findDockIconFor(dock, main_window);
|
wapp->app_icon = findDockIconFor(dock, main_window);
|
||||||
|
|
||||||
if (wapp->app_icon)
|
if (wapp->app_icon)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -432,7 +432,7 @@ static void miniwindowBalloon(WObjDescriptor * object)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void appiconBalloon(WObjDescriptor * object)
|
static void appiconBalloon(WObjDescriptor *object)
|
||||||
{
|
{
|
||||||
WAppIcon *aicon = (WAppIcon *) object->parent;
|
WAppIcon *aicon = (WAppIcon *) object->parent;
|
||||||
WScreen *scr = aicon->icon->core->screen_ptr;
|
WScreen *scr = aicon->icon->core->screen_ptr;
|
||||||
|
|||||||
@@ -2583,13 +2583,12 @@ static int setClipTitleFont(WScreen * scr, WDefaultEntry * entry, void *tdata, v
|
|||||||
return REFRESH_ICON_FONT;
|
return REFRESH_ICON_FONT;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int setLargeDisplayFont(WScreen * scr, WDefaultEntry * entry, void *tdata, void *foo)
|
static int setLargeDisplayFont(WScreen *scr, WDefaultEntry *entry, void *tdata, void *foo)
|
||||||
{
|
{
|
||||||
WMFont *font = tdata;
|
WMFont *font = tdata;
|
||||||
|
|
||||||
if (scr->workspace_name_font) {
|
if (scr->workspace_name_font)
|
||||||
WMReleaseFont(scr->workspace_name_font);
|
WMReleaseFont(scr->workspace_name_font);
|
||||||
}
|
|
||||||
|
|
||||||
scr->workspace_name_font = font;
|
scr->workspace_name_font = font;
|
||||||
|
|
||||||
|
|||||||
10
src/dock.c
10
src/dock.c
@@ -620,10 +620,10 @@ static void toggleAutoAttractCallback(WMenu *menu, WMenuEntry *entry)
|
|||||||
/* The newly auto-attracting dock is a drawer: disable any clip and
|
/* The newly auto-attracting dock is a drawer: disable any clip and
|
||||||
* previously attracting drawer */
|
* previously attracting drawer */
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < scr->workspace_count; i++) {
|
for (i = 0; i < scr->workspace_count; i++)
|
||||||
scr->workspaces[ i ]->clip->attract_icons = False;
|
scr->workspaces[ i ]->clip->attract_icons = False;
|
||||||
/* dock menu will be updated later, when opened */
|
/* dock menu will be updated later, when opened */
|
||||||
}
|
|
||||||
if (scr->attracting_drawer != NULL)
|
if (scr->attracting_drawer != NULL)
|
||||||
scr->attracting_drawer->attract_icons = False;
|
scr->attracting_drawer->attract_icons = False;
|
||||||
scr->attracting_drawer = dock;
|
scr->attracting_drawer = dock;
|
||||||
@@ -818,6 +818,7 @@ static WAppIcon *mainIconCreate(WScreen *scr, int type, const char *name)
|
|||||||
case WM_CLIP:
|
case WM_CLIP:
|
||||||
if (scr->clip_icon)
|
if (scr->clip_icon)
|
||||||
return scr->clip_icon;
|
return scr->clip_icon;
|
||||||
|
|
||||||
btn = wAppIconCreateForDock(scr, NULL, "Logo", "WMClip", TILE_CLIP);
|
btn = wAppIconCreateForDock(scr, NULL, "Logo", "WMClip", TILE_CLIP);
|
||||||
btn->icon->core->descriptor.handle_expose = clipIconExpose;
|
btn->icon->core->descriptor.handle_expose = clipIconExpose;
|
||||||
x_pos = 0;
|
x_pos = 0;
|
||||||
@@ -1210,6 +1211,7 @@ static WMenu *dockMenuCreate(WScreen *scr, int type)
|
|||||||
|
|
||||||
if (scr->clip_options == NULL)
|
if (scr->clip_options == NULL)
|
||||||
scr->clip_options = makeClipOptionsMenu(scr);
|
scr->clip_options = makeClipOptionsMenu(scr);
|
||||||
|
|
||||||
wMenuEntrySetCascade(menu, entry, scr->clip_options);
|
wMenuEntrySetCascade(menu, entry, scr->clip_options);
|
||||||
|
|
||||||
/* The same menu is used for the dock and its appicons. If the menu
|
/* The same menu is used for the dock and its appicons. If the menu
|
||||||
@@ -3957,9 +3959,9 @@ static void iconMouseDown(WObjDescriptor *desc, XEvent *event)
|
|||||||
iconDblClick(desc, event);
|
iconDblClick(desc, event);
|
||||||
}
|
}
|
||||||
} else if (event->xbutton.button == Button2 && aicon == scr->clip_icon) {
|
} else if (event->xbutton.button == Button2 && aicon == scr->clip_icon) {
|
||||||
if (!scr->clip_ws_menu) {
|
if (!scr->clip_ws_menu)
|
||||||
scr->clip_ws_menu = wWorkspaceMenuMake(scr, False);
|
scr->clip_ws_menu = wWorkspaceMenuMake(scr, False);
|
||||||
}
|
|
||||||
if (scr->clip_ws_menu) {
|
if (scr->clip_ws_menu) {
|
||||||
WMenu *wsMenu = scr->clip_ws_menu;
|
WMenu *wsMenu = scr->clip_ws_menu;
|
||||||
int xpos;
|
int xpos;
|
||||||
|
|||||||
@@ -838,23 +838,17 @@ static Bool checkWorkspaceChange(WWindow * wwin, MoveData * data, Bool opaqueMov
|
|||||||
|
|
||||||
if (data->mouseX <= 1) {
|
if (data->mouseX <= 1) {
|
||||||
if (scr->current_workspace > 0) {
|
if (scr->current_workspace > 0) {
|
||||||
|
|
||||||
crossWorkspace(scr, wwin, opaqueMove, scr->current_workspace - 1, True);
|
crossWorkspace(scr, wwin, opaqueMove, scr->current_workspace - 1, True);
|
||||||
changed = True;
|
changed = True;
|
||||||
data->rubCount = 0;
|
data->rubCount = 0;
|
||||||
|
|
||||||
} else if (scr->current_workspace == 0 && wPreferences.ws_cycle) {
|
} else if (scr->current_workspace == 0 && wPreferences.ws_cycle) {
|
||||||
|
|
||||||
crossWorkspace(scr, wwin, opaqueMove, scr->workspace_count - 1, True);
|
crossWorkspace(scr, wwin, opaqueMove, scr->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 == scr->workspace_count - 1) {
|
if (scr->current_workspace == scr->workspace_count - 1) {
|
||||||
|
|
||||||
if (wPreferences.ws_cycle || scr->workspace_count == MAX_WORKSPACES) {
|
if (wPreferences.ws_cycle || scr->workspace_count == MAX_WORKSPACES) {
|
||||||
|
|
||||||
crossWorkspace(scr, wwin, opaqueMove, 0, False);
|
crossWorkspace(scr, wwin, opaqueMove, 0, False);
|
||||||
changed = True;
|
changed = True;
|
||||||
data->rubCount = 0;
|
data->rubCount = 0;
|
||||||
@@ -883,7 +877,6 @@ static Bool checkWorkspaceChange(WWindow * wwin, MoveData * data, Bool opaqueMov
|
|||||||
data->rubCount = 0;
|
data->rubCount = 0;
|
||||||
}
|
}
|
||||||
} else if (scr->current_workspace < scr->workspace_count) {
|
} else if (scr->current_workspace < scr->workspace_count) {
|
||||||
|
|
||||||
/* go to next workspace */
|
/* go to next workspace */
|
||||||
crossWorkspace(scr, wwin, opaqueMove, scr->current_workspace + 1, False);
|
crossWorkspace(scr, wwin, opaqueMove, scr->current_workspace + 1, False);
|
||||||
changed = True;
|
changed = True;
|
||||||
@@ -1394,16 +1387,18 @@ 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 (!scr->current_workspace)
|
||||||
wWorkspaceChange(scr, scr->workspace_count - 1);
|
wWorkspaceChange(scr, scr->workspace_count - 1);
|
||||||
} else
|
else
|
||||||
wWorkspaceChange(scr, scr->current_workspace - 1);
|
wWorkspaceChange(scr, scr->current_workspace - 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 == scr->workspace_count - 1) {
|
if (scr->current_workspace == scr->workspace_count - 1)
|
||||||
wWorkspaceChange(scr, 0);
|
wWorkspaceChange(scr, 0);
|
||||||
} else
|
else
|
||||||
wWorkspaceChange(scr, scr->current_workspace + 1);
|
wWorkspaceChange(scr, scr->current_workspace + 1);
|
||||||
|
|
||||||
off_x -= scr_width;
|
off_x -= scr_width;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -755,7 +755,7 @@ static void constructPLMenuFromPipe(WMenu * menu, WMenuEntry * entry)
|
|||||||
wfree(cmd);
|
wfree(cmd);
|
||||||
|
|
||||||
}
|
}
|
||||||
static void cleanupWorkspaceMenu(WMenu * menu)
|
static void cleanupWorkspaceMenu(WMenu *menu)
|
||||||
{
|
{
|
||||||
if (menu->frame->screen_ptr->workspace_menu == menu)
|
if (menu->frame->screen_ptr->workspace_menu == menu)
|
||||||
menu->frame->screen_ptr->workspace_menu = NULL;
|
menu->frame->screen_ptr->workspace_menu = NULL;
|
||||||
|
|||||||
@@ -819,15 +819,12 @@ void wScreenRestoreState(WScreen * scr)
|
|||||||
wfree(path);
|
wfree(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!scr->session_state) {
|
if (!scr->session_state)
|
||||||
scr->session_state = WMCreatePLDictionary(NULL, NULL);
|
scr->session_state = WMCreatePLDictionary(NULL, NULL);
|
||||||
}
|
|
||||||
|
|
||||||
if (!wPreferences.flags.nodock) {
|
if (!wPreferences.flags.nodock) {
|
||||||
state = WMGetFromPLDictionary(scr->session_state, dDock);
|
state = WMGetFromPLDictionary(scr->session_state, dDock);
|
||||||
scr->dock = wDockRestoreState(scr, state, WM_DOCK);
|
scr->dock = wDockRestoreState(scr, state, WM_DOCK);
|
||||||
/* If clip_merged_in_dock, setting scr->clip_icon is done by
|
|
||||||
* wDockRestoreState()->wDockCreate()->mainIconCreate() */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wPreferences.flags.noclip) {
|
if (!wPreferences.flags.noclip) {
|
||||||
@@ -835,12 +832,10 @@ void wScreenRestoreState(WScreen * scr)
|
|||||||
scr->clip_icon = wClipRestoreState(scr, state);
|
scr->clip_icon = wClipRestoreState(scr, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wPreferences.flags.nodrawer) {
|
if (!wPreferences.flags.nodrawer)
|
||||||
wDrawersRestoreState(scr);
|
wDrawersRestoreState(scr);
|
||||||
}
|
|
||||||
|
|
||||||
wWorkspaceRestoreState(scr);
|
wWorkspaceRestoreState(scr);
|
||||||
|
|
||||||
wScreenUpdateUsableArea(scr);
|
wScreenUpdateUsableArea(scr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -198,9 +198,8 @@ static WMPropList *makeWindowState(WWindow * wwin, WApplication * wapp)
|
|||||||
|
|
||||||
name = WMCreatePLString(buffer);
|
name = WMCreatePLString(buffer);
|
||||||
cmd = WMCreatePLString(command);
|
cmd = WMCreatePLString(command);
|
||||||
/*sprintf(buffer, "%d", wwin->frame->workspace+1);
|
|
||||||
workspace = WMCreatePLString(buffer); */
|
|
||||||
workspace = WMCreatePLString(scr->workspaces[wwin->frame->workspace]->name);
|
workspace = WMCreatePLString(scr->workspaces[wwin->frame->workspace]->name);
|
||||||
|
|
||||||
shaded = wwin->flags.shaded ? sYes : sNo;
|
shaded = wwin->flags.shaded ? sYes : sNo;
|
||||||
miniaturized = wwin->flags.miniaturized ? sYes : sNo;
|
miniaturized = wwin->flags.miniaturized ? sYes : sNo;
|
||||||
hidden = wwin->flags.hidden ? sYes : sNo;
|
hidden = wwin->flags.hidden ? sYes : sNo;
|
||||||
@@ -233,22 +232,21 @@ static WMPropList *makeWindowState(WWindow * wwin, WApplication * wapp)
|
|||||||
if (wapp && wapp->app_icon && wapp->app_icon->dock) {
|
if (wapp && wapp->app_icon && wapp->app_icon->dock) {
|
||||||
int i;
|
int i;
|
||||||
char *name = NULL;
|
char *name = NULL;
|
||||||
if (wapp->app_icon->dock == scr->dock) {
|
if (wapp->app_icon->dock == scr->dock)
|
||||||
name = "Dock";
|
name = "Dock";
|
||||||
}
|
|
||||||
if (name == NULL) // Try the clips
|
/* Try the clips */
|
||||||
{
|
if (name == NULL) {
|
||||||
for (i = 0; i < scr->workspace_count; i++)
|
for (i = 0; i < scr->workspace_count; i++)
|
||||||
if (scr->workspaces[i]->clip == wapp->app_icon->dock)
|
if (scr->workspaces[i]->clip == wapp->app_icon->dock)
|
||||||
break;
|
break;
|
||||||
if (i < scr->workspace_count)
|
if (i < scr->workspace_count)
|
||||||
name = scr->workspaces[i]->name;
|
name = scr->workspaces[i]->name;
|
||||||
}
|
}
|
||||||
if (name == NULL) // Try the drawers
|
/* Try the drawers */
|
||||||
{
|
if (name == NULL) {
|
||||||
WDrawerChain *dc;
|
WDrawerChain *dc;
|
||||||
for (dc = scr->drawers; dc != NULL; dc = dc->next)
|
for (dc = scr->drawers; dc != NULL; dc = dc->next) {
|
||||||
{
|
|
||||||
if (dc->adrawer == wapp->app_icon->dock)
|
if (dc->adrawer == wapp->app_icon->dock)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -468,11 +466,11 @@ void wSessionRestoreState(WScreen *scr)
|
|||||||
value = WMGetFromPLDictionary(win_info, sDock);
|
value = WMGetFromPLDictionary(win_info, sDock);
|
||||||
if (value && WMIsPLString(value) && (tmp = WMGetFromPLString(value)) != NULL) {
|
if (value && WMIsPLString(value) && (tmp = WMGetFromPLString(value)) != NULL) {
|
||||||
if (sscanf(tmp, "%i", &n) != 1) {
|
if (sscanf(tmp, "%i", &n) != 1) {
|
||||||
if (!strcasecmp(tmp, "DOCK")) {
|
if (!strcasecmp(tmp, "DOCK"))
|
||||||
dock = scr->dock;
|
dock = scr->dock;
|
||||||
}
|
|
||||||
if (dock == NULL) // Try the clips
|
/* Try the clips */
|
||||||
{
|
if (dock == NULL) {
|
||||||
for (j = 0; j < scr->workspace_count; j++) {
|
for (j = 0; j < scr->workspace_count; j++) {
|
||||||
if (strcmp(scr->workspaces[j]->name, tmp) == 0) {
|
if (strcmp(scr->workspaces[j]->name, tmp) == 0) {
|
||||||
dock = scr->workspaces[j]->clip;
|
dock = scr->workspaces[j]->clip;
|
||||||
|
|||||||
@@ -571,12 +571,11 @@ 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 == scr->current_workspace)
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
menu->flags.realized = 0;
|
menu->flags.realized = 0;
|
||||||
wMenuRealize(menu);
|
wMenuRealize(menu);
|
||||||
|
|||||||
@@ -259,9 +259,8 @@ static void showWorkspaceName(WScreen * scr, int workspace)
|
|||||||
int xx, yy;
|
int xx, yy;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (wPreferences.workspace_name_display_position == WD_NONE || scr->workspace_count < 2) {
|
if (wPreferences.workspace_name_display_position == WD_NONE || scr->workspace_count < 2)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (scr->workspace_name_timer) {
|
if (scr->workspace_name_timer) {
|
||||||
WMDeleteTimerHandler(scr->workspace_name_timer);
|
WMDeleteTimerHandler(scr->workspace_name_timer);
|
||||||
@@ -350,11 +349,9 @@ static void showWorkspaceName(WScreen * scr, int workspace)
|
|||||||
|
|
||||||
XFillRectangle(dpy, text, WMColorGC(scr->black), 0, 0, w + 4, h + 4);
|
XFillRectangle(dpy, text, WMColorGC(scr->black), 0, 0, w + 4, h + 4);
|
||||||
|
|
||||||
for (x = 0; x <= 4; x++) {
|
for (x = 0; x <= 4; x++)
|
||||||
for (y = 0; y <= 4; y++) {
|
for (y = 0; y <= 4; y++)
|
||||||
WMDrawString(scr->wmscreen, text, scr->white, scr->workspace_name_font, x, y, name, len);
|
WMDrawString(scr->wmscreen, text, scr->white, scr->workspace_name_font, x, y, name, len);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
XSetForeground(dpy, scr->mono_gc, 1);
|
XSetForeground(dpy, scr->mono_gc, 1);
|
||||||
XSetBackground(dpy, scr->mono_gc, 0);
|
XSetBackground(dpy, scr->mono_gc, 0);
|
||||||
@@ -477,9 +474,8 @@ void wWorkspaceForceChange(WScreen * scr, int workspace)
|
|||||||
|
|
||||||
SendHelperMessage(scr, 'C', workspace + 1, NULL);
|
SendHelperMessage(scr, 'C', workspace + 1, NULL);
|
||||||
|
|
||||||
if (workspace > scr->workspace_count - 1) {
|
if (workspace > scr->workspace_count - 1)
|
||||||
wWorkspaceMake(scr, workspace - scr->workspace_count + 1);
|
wWorkspaceMake(scr, workspace - scr->workspace_count + 1);
|
||||||
}
|
|
||||||
|
|
||||||
wClipUpdateForWorkspaceChange(scr, workspace);
|
wClipUpdateForWorkspaceChange(scr, workspace);
|
||||||
|
|
||||||
@@ -644,12 +640,12 @@ static void switchWSCommand(WMenu * menu, WMenuEntry * entry)
|
|||||||
wWorkspaceChange(menu->frame->screen_ptr, (long)entry->clientdata);
|
wWorkspaceChange(menu->frame->screen_ptr, (long)entry->clientdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lastWSCommand(WMenu * menu, WMenuEntry * entry)
|
static void lastWSCommand(WMenu *menu, WMenuEntry *entry)
|
||||||
{
|
{
|
||||||
wWorkspaceChange(menu->frame->screen_ptr, menu->frame->screen_ptr->last_workspace);
|
wWorkspaceChange(menu->frame->screen_ptr, menu->frame->screen_ptr->last_workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void deleteWSCommand(WMenu * menu, WMenuEntry * entry)
|
static void deleteWSCommand(WMenu *menu, WMenuEntry *entry)
|
||||||
{
|
{
|
||||||
wWorkspaceDelete(menu->frame->screen_ptr, menu->frame->screen_ptr->workspace_count - 1);
|
wWorkspaceDelete(menu->frame->screen_ptr, menu->frame->screen_ptr->workspace_count - 1);
|
||||||
}
|
}
|
||||||
@@ -768,10 +764,9 @@ void wWorkspaceMenuUpdate(WScreen * scr, WMenu * menu)
|
|||||||
}
|
}
|
||||||
} else if (menu->entry_no > scr->workspace_count + MC_WORKSPACE1) {
|
} else if (menu->entry_no > scr->workspace_count + MC_WORKSPACE1) {
|
||||||
/* removed workspace(s) */
|
/* removed workspace(s) */
|
||||||
for (i = menu->entry_no - 1; i >= scr->workspace_count + MC_WORKSPACE1; i--) {
|
for (i = menu->entry_no - 1; i >= scr->workspace_count + MC_WORKSPACE1; i--)
|
||||||
wMenuRemoveItem(menu, i);
|
wMenuRemoveItem(menu, i);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < scr->workspace_count; i++) {
|
for (i = 0; i < scr->workspace_count; i++) {
|
||||||
/* workspace shortcut labels */
|
/* workspace shortcut labels */
|
||||||
@@ -786,11 +781,10 @@ void wWorkspaceMenuUpdate(WScreen * scr, WMenu * menu)
|
|||||||
wMenuRealize(menu);
|
wMenuRealize(menu);
|
||||||
|
|
||||||
/* don't let user destroy current workspace */
|
/* don't let user destroy current workspace */
|
||||||
if (scr->current_workspace == scr->workspace_count - 1) {
|
if (scr->current_workspace == scr->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 (scr->workspace_count && scr->last_workspace != scr->current_workspace)
|
if (scr->workspace_count && scr->last_workspace != scr->current_workspace)
|
||||||
|
|||||||
Reference in New Issue
Block a user