Skip to content

Commit f48f136

Browse files
author
lav
committed
* xrus.c, xrus.h, props.c: support WM_DELETE_WINDOW properly in Xaw mode.
* Xrus.ad: set iconName for Xaw properties/error windows.
1 parent 76bbf9f commit f48f136

File tree

5 files changed

+39
-3
lines changed

5 files changed

+39
-3
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2001-08-16 lav
2+
3+
* xrus.c, xrus.h, props.c: support WM_DELETE_WINDOW properly in Xaw mode.
4+
* Xrus.ad: set iconName for Xaw properties/error windows.
5+
16
2001-05-25 lav
27

38
* xrus.c, xrus.h: add keylog support; handle SIGUSR1 and SIGUSR2.

Xrus.ad

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ xrus.form.vSpace: 0
344344
!-------------------------------------------------------
345345

346346
*props_xaw*title: Properties
347+
*props_xaw*iconName: Xrus Properties
347348

348349
*props_xaw*locker_toggle.label: Locking
349350

@@ -493,3 +494,4 @@ xrus.form.vSpace: 0
493494
*props_xaw*cancel_button.fromVert: default2_button
494495

495496
*props_xaw.error_shell.title: Error
497+
*props_xaw.error_shell.iconName: Xrus Error

props.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ int PropsApply()
263263
"Ok", ErrorDismiss_CB, (XtPointer) error_shell);
264264

265265
XtPopup(error_shell, XtGrabExclusive);
266+
XSetWMProtocols(disp,XtWindow(error_shell),&wm_delete_window,1);
266267

267268
#endif /* TK==TK_XAW */
268269
return 0;
@@ -680,8 +681,12 @@ void PropsPopup()
680681
}
681682
#endif /* TK_MOTIF */
682683

683-
XtPopup(props.shell, XtGrabNone);
684-
}
684+
XtPopup(props.shell, XtGrabNone);
685+
686+
#if TK==TK_XAW
687+
XSetWMProtocols(disp,XtWindow(props.shell),&wm_delete_window,1);
688+
#endif
689+
} /* End of PropsPopup */
685690
#else /* TK_NONE */
686691
void PropsPopup() {}
687692
#endif

xrus.c

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ XrmOptionDescRec options[]=
218218
};
219219

220220
Display *disp;
221+
Atom wm_delete_window;
222+
Atom wm_protocols;
221223
XtAppContext app_context;
222224

223225
#define StartArgs() count=0
@@ -1220,6 +1222,27 @@ void MainLoop(void)
12201222
(XtTimerCallbackProc)SetTitleIndicatorOnTimeout,
12211223
(XtPointer)ev.xproperty.window);
12221224
}
1225+
break;
1226+
#if TK==TK_XAW
1227+
case(ClientMessage):
1228+
fflush(stdout);
1229+
if(ev.xclient.message_type==wm_protocols && ev.xclient.format==32
1230+
&& ev.xclient.data.l[0]==wm_delete_window)
1231+
{
1232+
if(ev.xclient.window==XtWindow(top_level))
1233+
{
1234+
XtDestroyApplicationContext(app_context);
1235+
app_context=NULL;
1236+
}
1237+
else
1238+
{
1239+
Widget w=XtWindowToWidget(disp,ev.xclient.window);
1240+
if(w)
1241+
XtPopdown(w);
1242+
}
1243+
}
1244+
break;
1245+
#endif /* TK_XAW */
12231246
}
12241247
}
12251248
}
@@ -1408,7 +1431,6 @@ int main(int argc,char **argv)
14081431
int scr;
14091432

14101433
Window w;
1411-
Atom wm_delete_window;
14121434
Atom wm_client_leader;
14131435

14141436
int saved_argc=argc;
@@ -1637,6 +1659,7 @@ int main(int argc,char **argv)
16371659

16381660
wm_client_leader=XInternAtom(disp,"WM_CLIENT_LEADER",False);
16391661
wm_delete_window=XInternAtom(disp,"WM_DELETE_WINDOW",False);
1662+
wm_protocols=XInternAtom(disp,"WM_PROTOCOLS",False);
16401663

16411664
XChangeProperty(disp,w,ol_decor_del_atom,XA_ATOM,32,
16421665
PropModeReplace,(void*)ol_decor_del,2);

xrus.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ extern char DefaultToRusKeys[];
5353
extern char DefaultSwitchForOneKeys[];
5454

5555
extern Display *disp;
56+
extern Atom wm_delete_window;
5657
extern XtAppContext app_context;
5758

5859
#define StartArgs() count=0

0 commit comments

Comments
 (0)