1 Index: gtk/gui-top-window.c
2 ===================================================================
3 RCS file: /cvsroot/pcb/pcb/src/hid/gtk/gui-top-window.c,v
4 retrieving revision 1.34
5 diff -U3 -p -r1.34 gui-top-window.c
6 --- gtk/gui-top-window.c 19 Oct 2006 22:42:56 -0000 1.34
7 +++ gtk/gui-top-window.c 2 Dec 2006 13:54:14 -0000
12 +// TODO: Does the GTK HID ASSUME X11?
13 +#include <gdk/gdkx.h> // For gdk_x11_window_set_user_time ()
18 @@ -3861,8 +3864,65 @@ LayersChanged (int argc, char **argv, in
22 +static const char window_set_wm_time_syntax[] =
23 +"WindowSetWMTime ( timestamp )";
25 +static const char window_set_wm_time_help[] =
26 +"Sets the _WM_USER_TIME property on the main window. The timestamp should "
27 +"be a valid X11 Timestamp representing the last user interaction with the "
28 +"app. This action allows a project manager (or other app) to forward this "
29 +"Timestamp when requesting PCB raise above its own window.";
31 +/* %start-doc actions WindowSetWMTime
33 +This action is used to set the _WM_USER_TIME property to allow raising
34 +of the window with some window managers.
39 +WindowSetWMTime (int argc, char **argv, int x, int y)
41 + long timestamp_long;
45 + fprintf( stderr, "Need one argument" );
48 + timestamp_long = atol( argv[0] );
50 + gdk_x11_window_set_user_time( GTK_WIDGET (gport->top_window)->window,
56 +static const char window_raise_syntax[] =
59 +static const char window_raise_help[] =
60 +"Raises the main window.";
62 +/* %start-doc actions WindowRaise
64 +This action is used to raise PCB's main window
69 +WindowRaise (int argc, char **argv, int x, int y)
71 + gdk_window_raise(GTK_WIDGET (gport->top_window)->window );
75 HID_Action gtk_topwindow_action_list[] = {
76 - {"LayersChanged", 0, LayersChanged}
77 + {"LayersChanged", 0, LayersChanged},
78 + {"WindowSetWMTime", 0, WindowSetWMTime,
79 + window_set_wm_time_help, window_set_wm_time_syntax},
80 + {"WindowRaise", 0, WindowRaise,
81 + window_raise_help, window_raise_syntax}
84 REGISTER_ACTIONS (gtk_topwindow_action_list)
86 ===================================================================
87 RCS file: /cvsroot/pcb/pcb/src/hid/lesstif/main.c,v
88 retrieving revision 1.38
89 diff -U3 -p -r1.38 main.c
90 --- lesstif/main.c 10 Oct 2006 10:49:58 -0000 1.38
91 +++ lesstif/main.c 2 Dec 2006 13:54:15 -0000
92 @@ -812,6 +814,62 @@ Benchmark (int argc, char **argv, int x,
96 +static const char window_set_wm_time_syntax[] =
97 +"WindowSetWMTime ( timestamp )";
99 +static const char window_set_wm_time_help[] =
100 +"Sets the _WM_USER_TIME property on the main window. The timestamp should "
101 +"be a valid X11 Timestamp representing the last user interaction with the "
102 +"app. This action allows a project manager (or other app) to forward this "
103 +"Timestamp when requesting PCB raise above its own window.";
105 +/* %start-doc actions WindowSetWMTime
107 +This action is used to set the _WM_USER_TIME property to allow raising
108 +of the window with some window managers.
113 +WindowSetWMTime (int argc, char **argv, int x, int y)
115 + long timestamp_long;
119 + fprintf( stderr, "Need one argument" );
122 + timestamp_long = atol( argv[0] );
124 + XChangeProperty (display, XtWindow( appwidget ),
125 + XInternAtom( display, "_NET_WM_USER_TIME", 0),
126 + XA_CARDINAL, 32, PropModeReplace,
127 + (unsigned char *)×tamp_long, 1);
133 +static const char window_raise_syntax[] =
136 +static const char window_raise_help[] =
137 +"Raises the main window.";
139 +/* %start-doc actions WindowRaise
141 +This action is used to raise PCB's main window
146 +WindowRaise (int argc, char **argv, int x, int y)
148 + XRaiseWindow( display, XtWindow( appwidget ));
152 HID_Action lesstif_main_action_list[] = {
153 {"PCBChanged", 0, PCBChanged,
154 pcbchanged_help, pcbchanged_syntax},
155 @@ -830,7 +888,11 @@ HID_Action lesstif_main_action_list[] =
156 {"Command", 0, Command,
157 command_help, command_syntax},
158 {"Benchmark", 0, Benchmark,
159 - benchmark_help, benchmark_syntax}
160 + benchmark_help, benchmark_syntax},
161 + {"WindowSetWMTime", 0, WindowSetWMTime,
162 + window_set_wm_time_help, window_set_wm_time_syntax},
163 + {"WindowRaise", 0, WindowRaise,
164 + window_raise_help, window_raise_syntax}
167 REGISTER_ACTIONS (lesstif_main_action_list)