]> git.pld-linux.org Git - packages/dosemu.git/blob - dosemu-Xquit.patch
30fc6ccabcfc8e13de76e99c9d7c945d5ac16581
[packages/dosemu.git] / dosemu-Xquit.patch
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
4 @@ -383,6 +383,9 @@
5  static Atom comm_atom = None;
6  static Boolean kdos_client = FALSE;            /* started by kdos */
7  
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  
12  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13  
14 @@ -1434,6 +1437,7 @@
15           
16         case FocusIn:
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 ();
21           have_focus = TRUE;
22 @@ -1441,6 +1445,7 @@
23  
24         case FocusOut:
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.
32            */
33           if(e.xclient.message_type == proto_atom && *e.xclient.data.l == delete_atom) {
34 +           int i;
35 +
36             X_printf("X: got window delete message\n");
37 -           /* XXX - Is it ok to call this from a SIGALRM handler? */
38 -           leavedos(0);
39 +
40 +           if (about_to_quit)
41 +               break;
42 +
43 +           about_to_quit = TRUE;
44 +           Draw_cursor_backup = Text_X.Draw_cursor;
45 +           Text_X.Draw_cursor = NULL;
46 +           freeze_dosemu();
47 +
48 +            for (i = 0; i < 12; i++)
49 +               Text_X.Draw_string(14, i+6, "                                                    " , 52, 0xf0);
50 +
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);
61 +           
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);
65 +           
66             break;
67           }
68  
69 @@ -1490,6 +1522,24 @@
70             keyrel_pending = 0;
71           }
72  
73 +          if (about_to_quit) {
74 +               KeySym keysym = XKeycodeToKeysym(display, e.xkey.keycode, 0);
75 +               if (keysym == XK_Y || keysym == XK_y) {
76 +                  leavedos(0);
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();
82 +                   } else {
83 +                       dirty_all_video_pages();
84 +                       X_update_screen();
85 +                   }
86 +                   unfreeze_dosemu();
87 +               }
88 +               break;
89 +          }
90 +
91            if((e.xkey.state & ControlMask) && (e.xkey.state & Mod1Mask)) {
92              KeySym keysym = XKeycodeToKeysym(display, e.xkey.keycode, 0);
93              if (keysym == grab_keysym) {
94 @@ -1504,6 +1554,7 @@
95                break;
96              }
97            }
98 +          
99  /* 
100        Clears the visible selection if the cursor is inside the selection
101  */
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
105 @@ -195,8 +195,7 @@
106    text_colors[i] = xc.pixel;
107  }
108  
109 -
110 -static struct text_system Text_X =
111 +struct text_system Text_X =
112  {
113     X_draw_string, 
114     X_draw_line,
This page took 0.044205 seconds and 2 git commands to generate.