The attached patch is for IRC user skilz who wanted to be able to restart the workspace manager after running xrandr in a script. it adds the RestartWorkspaceManager action and a new tooltalk Op to WmIPC.c in dtwm to enable it to handle the new action and restart it self.

It might make a nice new feature. for example I include a file from the debian menu system into my dtwmrc in order to get the Debian menu. packages for debian could include a hook that causes the workspace manager to be restarted when the menu is updated.


>From 9b9f0410ef277a6f18a26bcf6875b1caf27dc514 Mon Sep 17 00:00:00 2001
From: William Schaub <wsch...@genesi-tech.com>
Date: Mon, 13 Aug 2012 16:44:42 -0400
Subject: [PATCH] dtwm: add RestartWorkSpaceManager action and DtWorkspace_Restart TT op
 to allow the workspace manager to be restarted by a simple call to dtaction

---
 cde/programs/dtwm/WmIPC.c    |   10 ++++++++++
 cde/programs/types/dt.dt.src |   13 +++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/cde/programs/dtwm/WmIPC.c b/cde/programs/dtwm/WmIPC.c
index 331f43b..dcec51e 100644
--- a/cde/programs/dtwm/WmIPC.c
+++ b/cde/programs/dtwm/WmIPC.c
@@ -288,6 +288,11 @@ dtInitializeMessaging(Widget toplevel)
         ToolTalkError(toplevel, errfmt, status);
 	return;
     }
+    status = tt_pattern_op_add(request_pattern,"DtWorkspace_Restart");
+    if(status != TT_OK) {
+        ToolTalkError(toplevel, errfmt, status);
+    return;
+    }
     status = tt_pattern_op_add(request_pattern, "DtWorkspace_SetCurrent");
     if (status != TT_OK) {
         ToolTalkError(toplevel, errfmt, status);
@@ -734,6 +739,11 @@ RequestMsgCB(Tt_message m, Tt_pattern p)
 
 	F_Restart( DTWM_REQP_NO_CONFIRM, NULL, NULL );
     }
+    else if (!strcmp(op,"DtWorkspace_Restart")) {
+        tt_message_reply(m);
+        tt_message_destroy(m);
+        F_Restart( DTWM_REQP_NO_CONFIRM, NULL, NULL );
+    }
     else if (!strcmp(op, "DtWorkspace_SetCurrent")) {
 	/*
 	 * 1st arg: integer, screen number
diff --git a/cde/programs/types/dt.dt.src b/cde/programs/types/dt.dt.src
index a960851..45b9d1c 100644
--- a/cde/programs/types/dt.dt.src
+++ b/cde/programs/types/dt.dt.src
@@ -375,6 +375,19 @@ ACTION RestorePanel
 
 XCOMM ######
 
+ACTION RestartWorkspaceManager
+{
+    LABEL       Riestart Workspace Manager
+        TYPE            TT_MSG
+        TT_CLASS    TT_REQUEST
+        TT_SCOPE    TT_SESSION
+        TT_OPERATION    DtWorkspace_Restart
+        DESCRIPTION     Restart the Workspace Manager.
+}
+
+
+XCOMM ######
+
 ACTION Dtmail
 {
 	LABEL		%|nls-2026-#Mailer#|
-- 
1.7.2.5

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to