]> git.pld-linux.org Git - packages/dosemu.git/blob - dosemu-Xquit.patch
- BR: xorg-app-mkfontdir
[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 22:27:07.000000000 +0100
4 @@ -383,6 +383,10 @@
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 +void (*Draw_string_backup)(int x, int y , unsigned char *s, int len, Bit8u attr); 
12  
13  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14  
15 @@ -486,6 +490,16 @@
16  
17  /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
18  
19 +void Draw_cursor_fake(int x, int y, Bit8u attr, int first, int last, Boolean focus)
20 +{
21 +       return;
22 +}
23 +
24 +void Draw_string_fake(int x, int y , unsigned char *s, int len, Bit8u attr)
25 +{
26 +       return;
27 +}
28 +
29  /* utility function for opening a connection and making certain
30   * I am either using or not using the X keyboard Extension.
31   */
32 @@ -1458,9 +1472,38 @@
33            * atom, it means the window manager wants us to die.
34            */
35           if(e.xclient.message_type == proto_atom && *e.xclient.data.l == delete_atom) {
36 +           int i;
37 +
38             X_printf("X: got window delete message\n");
39 -           /* XXX - Is it ok to call this from a SIGALRM handler? */
40 -           leavedos(0);
41 +
42 +           if (about_to_quit)
43 +               break;
44 +
45 +           about_to_quit = TRUE;
46 +           Draw_cursor_backup = Text_X.Draw_cursor;
47 +           Text_X.Draw_cursor = Draw_cursor_fake;
48 +
49 +            for (i = 0; i < 12; i++)
50 +               Text_X.Draw_string(14, i+6, "                                                    " , 52, 0xf0);
51 +
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);
62 +           
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);
66 +           
67 +           Draw_string_backup = Text_X.Draw_string;
68 +           Text_X.Draw_string = Draw_string_fake;
69 +           
70             break;
71           }
72  
73 @@ -1490,6 +1533,24 @@
74             keyrel_pending = 0;
75           }
76  
77 +          if (about_to_quit) {
78 +               KeySym keysym = XKeycodeToKeysym(display, e.xkey.keycode, 0);
79 +               if (keysym == XK_Y || keysym == XK_y) {
80 +                  leavedos(0);
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();
87 +                   } else {
88 +                       dirty_all_video_pages();
89 +                       X_update_screen();
90 +                   }
91 +               }
92 +               break;
93 +          }
94 +
95            if((e.xkey.state & ControlMask) && (e.xkey.state & Mod1Mask)) {
96              KeySym keysym = XKeycodeToKeysym(display, e.xkey.keycode, 0);
97              if (keysym == grab_keysym) {
98 @@ -1504,6 +1565,7 @@
99                break;
100              }
101            }
102 +          
103  /* 
104        Clears the visible selection if the cursor is inside the selection
105  */
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
109 @@ -195,8 +195,7 @@
110    text_colors[i] = xc.pixel;
111  }
112  
113 -
114 -static struct text_system Text_X =
115 +struct text_system Text_X =
116  {
117     X_draw_string, 
118     X_draw_line,
This page took 0.030731 seconds and 3 git commands to generate.