Hi,

The variable phase2 can be removed. Is only used in one place. This patch is for awmaker, but probably it could be adapted to wmaker.

Cheers,
kix
Rodolfo García Peñas (kix)
http://www.kix.es/
>From 658e5cd52c791b1e0e56c2f20c3d13f745737fcb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?=
 <k...@kix.es>
Date: Mon, 20 Jul 2015 00:50:45 +0200
Subject: [PATCH] Removed w_global.startup.phase2 variable

The variable w_global.startup.phase2 can be removed because is used only
in the function wWorkspaceForceChange, so we can remove the call and the
if about this variable.
---
 src/WindowMaker.h | 1 -
 src/startup.c     | 5 -----
 src/workspace.c   | 2 +-
 3 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 1f466a6..a72124a 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -502,7 +502,6 @@ extern struct wmaker_global_variables {
 	/* Window Maker startup phases */
 	struct {
 		unsigned int phase1:1;
-		unsigned int phase2:1;
 	} startup;
 
 	/* locale to use. NULL==POSIX or C */
diff --git a/src/startup.c b/src/startup.c
index decea51..23f4cef 100644
--- a/src/startup.c
+++ b/src/startup.c
@@ -695,8 +695,6 @@ void StartUp(Bool defaultScreenOnly)
 
 		manageAllWindows(w_global.vscreens[j], wPreferences.flags.restarting == 2);
 
-		w_global.startup.phase2 = 1;
-
 		while (XPending(dpy)) {
 			XEvent ev;
 			WMNextEvent(dpy, &ev);
@@ -704,12 +702,9 @@ void StartUp(Bool defaultScreenOnly)
 		}
 
 		vscr->workspace.last_used = 0;
-		wWorkspaceForceChange(vscr, 0);
 		if (!wPreferences.flags.noclip)
 			wDockShowIcons(vscr->workspace.array[vscr->workspace.current]->clip);
 
-		w_global.startup.phase2 = 0;
-
 		/* restore saved menus */
 		wMenuRestoreState(w_global.vscreens[j]);
 
diff --git a/src/workspace.c b/src/workspace.c
index f4ff4a0..596ba8f 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -540,7 +540,7 @@ static void showWorkspaceName(virtual_screen *vscr, int workspace)
 
 void wWorkspaceChange(virtual_screen *vscr, int workspace)
 {
-	if (w_global.startup.phase1 || w_global.startup.phase2 || vscr->screen_ptr->flags.ignore_focus_events)
+	if (w_global.startup.phase1 || vscr->screen_ptr->flags.ignore_focus_events)
 		return;
 
 	if (workspace != vscr->workspace.current)
-- 
2.1.4

Reply via email to