From: "Rodolfo García Peñas (kix)" <[email protected]>
The function wWorkspaceMenuUpdate() udpates the menu entries
using the scr->current_workspace variable. The problem is that
variable could be NULL, so wmaker will crash.
This patch include a new check to verify that scr->current_workspace
exists before use it.
---
src/workspace.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/workspace.c b/src/workspace.c
index b4cccd0..29aab12 100644
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -743,7 +743,7 @@ WMenu *wWorkspaceMenuMake(WScreen * scr, Bool titled)
return wsmenu;
}
-void wWorkspaceMenuUpdate(WScreen * scr, WMenu * menu)
+void wWorkspaceMenuUpdate(WScreen *scr, WMenu *menu)
{
int i;
long ws;
@@ -751,7 +751,12 @@ void wWorkspaceMenuUpdate(WScreen * scr, WMenu * menu)
WMenuEntry *entry;
int tmp;
- if (!menu)
+ /*
+ * If the scr->current_workspace doesn't exists yet
+ * is because we are starting wmaker, so we don't need
+ * the workspace menu yet
+ */
+ if (!menu || !scr->current_workspace)
return;
if (menu->entry_no < scr->workspace_count + MC_WORKSPACE1) {
--
1.7.10.4
--
To unsubscribe, send mail to [email protected].