1 diff -Nur dosemu-1.4.0.orig/src/plugin/X/X.c dosemu-1.4.0.chng/src/plugin/X/X.c
2 --- dosemu-1.4.0.orig/src/plugin/X/X.c 2007-05-04 07:59:48.000000000 +0200
3 +++ dosemu-1.4.0.chng/src/plugin/X/X.c 2008-01-30 22:27:07.000000000 +0100
5 static Atom comm_atom = None;
6 static Boolean kdos_client = FALSE; /* started by kdos */
8 +static Boolean about_to_quit = FALSE;
9 +extern struct text_system Text_X;
10 +void (*Draw_cursor_backup)(int x, int y, Bit8u attr, int first, int last, Boolean focus);
11 +void (*Draw_string_backup)(int x, int y , unsigned char *s, int len, Bit8u attr);
13 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
17 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
19 +void Draw_cursor_fake(int x, int y, Bit8u attr, int first, int last, Boolean focus)
24 +void Draw_string_fake(int x, int y , unsigned char *s, int len, Bit8u attr)
29 /* utility function for opening a connection and making certain
30 * I am either using or not using the X keyboard Extension.
32 @@ -1458,9 +1472,38 @@
33 * atom, it means the window manager wants us to die.
35 if(e.xclient.message_type == proto_atom && *e.xclient.data.l == delete_atom) {
38 X_printf("X: got window delete message\n");
39 - /* XXX - Is it ok to call this from a SIGALRM handler? */
45 + about_to_quit = TRUE;
46 + Draw_cursor_backup = Text_X.Draw_cursor;
47 + Text_X.Draw_cursor = Draw_cursor_fake;
49 + for (i = 0; i < 12; i++)
50 + Text_X.Draw_string(14, i+6, " " , 52, 0xf0);
52 + Text_X.Draw_string(15, 7, " " , 50, 0x4f);
53 + Text_X.Draw_string(15, 8, " You are about to abort DosEmu session. " , 50, 0x4f);
54 + Text_X.Draw_string(15, 9, " This is not recomended way for closing DosEmu. " , 50, 0x4f);
55 + Text_X.Draw_string(15, 10, " Close all your programs and use exitemu command. " , 50, 0x4f);
56 + Text_X.Draw_string(15, 11, " " , 50, 0x4f);
57 + Text_X.Draw_string(15, 12, " Do you still want to continue? " , 50, 0x4f);
58 + Text_X.Draw_string(15, 13, " " , 50, 0x4f);
59 + Text_X.Draw_string(15, 14, " Y - abort DosEmu session " , 50, 0x4f);
60 + Text_X.Draw_string(15, 15, " N - continue DosEmu session " , 50, 0x4f);
61 + Text_X.Draw_string(15, 16, " " , 50, 0x4f);
63 + Text_X.Draw_string(48, 10, "exitemu" , 7, 0x4a);
64 + Text_X.Draw_string(18, 14, "Y" , 1, 0x4e);
65 + Text_X.Draw_string(18, 15, "N" , 1, 0x4e);
67 + Draw_string_backup = Text_X.Draw_string;
68 + Text_X.Draw_string = Draw_string_fake;
73 @@ -1490,6 +1533,24 @@
77 + if (about_to_quit) {
78 + KeySym keysym = XKeycodeToKeysym(display, e.xkey.keycode, 0);
79 + if (keysym == XK_Y || keysym == XK_y) {
81 + } else if (keysym == XK_N || keysym == XK_n) {
82 + about_to_quit = FALSE;
83 + Text_X.Draw_cursor = Draw_cursor_backup;
84 + Text_X.Draw_string = Draw_string_backup;
85 + if(vga.mode_class == TEXT) {
86 + X_redraw_text_screen();
88 + dirty_all_video_pages();
95 if((e.xkey.state & ControlMask) && (e.xkey.state & Mod1Mask)) {
96 KeySym keysym = XKeycodeToKeysym(display, e.xkey.keycode, 0);
97 if (keysym == grab_keysym) {
104 Clears the visible selection if the cursor is inside the selection
106 diff -Nur dosemu-1.4.0.orig/src/plugin/X/X_font.c dosemu-1.4.0.chng/src/plugin/X/X_font.c
107 --- dosemu-1.4.0.orig/src/plugin/X/X_font.c 2007-05-04 07:59:48.000000000 +0200
108 +++ dosemu-1.4.0.chng/src/plugin/X/X_font.c 2008-01-30 10:04:00.000000000 +0100
110 text_colors[i] = xc.pixel;
114 -static struct text_system Text_X =
115 +struct text_system Text_X =