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 12:09:47.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);
12 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
17 X_printf("X: focus in\n");
18 + if (about_to_quit) break;
19 if (vga.mode_class == TEXT) text_gain_focus();
20 if (config.X_background_pause && !dosemu_user_froze) unfreeze_dosemu ();
25 X_printf("X: focus out\n");
26 + if (about_to_quit) break;
27 if (mainwindow == fullscreenwindow) break;
28 if (vga.mode_class == TEXT) text_lose_focus();
29 output_byte_8042(port60_buffer | 0x80);
30 @@ -1458,9 +1463,36 @@
31 * atom, it means the window manager wants us to die.
33 if(e.xclient.message_type == proto_atom && *e.xclient.data.l == delete_atom) {
36 X_printf("X: got window delete message\n");
37 - /* XXX - Is it ok to call this from a SIGALRM handler? */
43 + about_to_quit = TRUE;
44 + Draw_cursor_backup = Text_X.Draw_cursor;
45 + Text_X.Draw_cursor = NULL;
48 + for (i = 0; i < 12; i++)
49 + Text_X.Draw_string(14, i+6, " " , 52, 0xf0);
51 + Text_X.Draw_string(15, 7, " " , 50, 0x4f);
52 + Text_X.Draw_string(15, 8, " You are about to abort DosEmu session. " , 50, 0x4f);
53 + Text_X.Draw_string(15, 9, " This is not recomended way for closing DosEmu. " , 50, 0x4f);
54 + Text_X.Draw_string(15, 10, " Close all your programs and use exitemu command. " , 50, 0x4f);
55 + Text_X.Draw_string(15, 11, " " , 50, 0x4f);
56 + Text_X.Draw_string(15, 12, " Do you still want to continue? " , 50, 0x4f);
57 + Text_X.Draw_string(15, 13, " " , 50, 0x4f);
58 + Text_X.Draw_string(15, 14, " Y - abort DosEmu session " , 50, 0x4f);
59 + Text_X.Draw_string(15, 15, " N - continue DosEmu session " , 50, 0x4f);
60 + Text_X.Draw_string(15, 16, " " , 50, 0x4f);
62 + Text_X.Draw_string(48, 10, "exitemu" , 7, 0x4a);
63 + Text_X.Draw_string(18, 14, "Y" , 1, 0x4e);
64 + Text_X.Draw_string(18, 15, "N" , 1, 0x4e);
69 @@ -1490,6 +1522,24 @@
73 + if (about_to_quit) {
74 + KeySym keysym = XKeycodeToKeysym(display, e.xkey.keycode, 0);
75 + if (keysym == XK_Y || keysym == XK_y) {
77 + } else if (keysym == XK_N || keysym == XK_n) {
78 + about_to_quit = FALSE;
79 + Text_X.Draw_cursor = Draw_cursor_backup;
80 + if(vga.mode_class == TEXT) {
81 + X_redraw_text_screen();
83 + dirty_all_video_pages();
91 if((e.xkey.state & ControlMask) && (e.xkey.state & Mod1Mask)) {
92 KeySym keysym = XKeycodeToKeysym(display, e.xkey.keycode, 0);
93 if (keysym == grab_keysym) {
100 Clears the visible selection if the cursor is inside the selection
102 diff -Nur dosemu-1.4.0.orig/src/plugin/X/X_font.c dosemu-1.4.0.chng/src/plugin/X/X_font.c
103 --- dosemu-1.4.0.orig/src/plugin/X/X_font.c 2007-05-04 07:59:48.000000000 +0200
104 +++ dosemu-1.4.0.chng/src/plugin/X/X_font.c 2008-01-30 10:04:00.000000000 +0100
106 text_colors[i] = xc.pixel;
110 -static struct text_system Text_X =
111 +struct text_system Text_X =