--- uae/src/xwin.c 2018/04/24 16:44:42 1.1.1.6 +++ uae/src/xwin.c 2018/04/24 16:47:20 1.1.1.7 @@ -115,6 +115,7 @@ struct disp_info { static Display *display; static int screen; static Window rootwin, mywin; +static Atom delete_win; static GC mygc; static XColor black, white; @@ -170,7 +171,7 @@ static void handle_inhibit (void); static void framerate_up (void); static void framerate_down (void); - +static void handle_interpol (void); static struct uae_hotkeys hotkeys[] = { #ifdef USE_DGA_EXTENSION {{ XK_F12, XK_s, 0 }, handle_modeswitch, -1, 0 }, @@ -179,6 +180,7 @@ static struct uae_hotkeys hotkeys[] = { {{ XK_F12, XK_m, 0 }, togglemouse, -1, 0 }, {{ XK_F12, XK_g, 0 }, handle_mousegrab, -1, 0 }, {{ XK_F12, XK_i, 0 }, handle_inhibit, -1, 0 }, + {{ XK_F12, XK_p, 0 }, handle_interpol, -1, 0 }, {{ XK_F12, XK_KP_Add, 0 }, framerate_up, -1, 0 }, {{ XK_F12, XK_KP_Subtract, 0 }, framerate_down, -1, 0 }, {{ XK_Scroll_Lock, 0 }, handle_inhibit, -1, 0 }, @@ -717,6 +719,8 @@ static void graphics_subinit (void) { int i, j; XSetWindowAttributes wattr; + XClassHint classhint; + XWMHints *hints; unsigned long valuemask; dgamode = screen_is_picasso ? currprefs.gfx_pfullscreen : currprefs.gfx_afullscreen; @@ -739,11 +743,29 @@ static void graphics_subinit (void) wattr.event_mask = EVENTMASK; XSync (display, 0); + delete_win = XInternAtom(display, "WM_DELETE_WINDOW", False); mywin = XCreateWindow (display, rootwin, 0, 0, current_width, current_height, 0, bitdepth, InputOutput, vis, valuemask, &wattr); + XSetWMProtocols (display, mywin, &delete_win, 1); XSync (display, 0); XStoreName (display, mywin, "UAE"); + XSetIconName (display, mywin, "UAE Screen"); + + /* set class hint */ + classhint.res_name = "UAE"; + classhint.res_class = "UAEScreen"; + XSetClassHint(display, mywin, &classhint); + + hints = XAllocWMHints(); + /* Set window group leader to self to become an application + * that can be hidden by e.g. WindowMaker. + * Would be more useful if we could find out what the + * (optional) GTK+ window ID is :-/ */ + hints->window_group = mywin; + hints->flags = WindowGroupHint; + XSetWMHints(display, mywin, hints); + XMapRaised (display, mywin); XSync (display, 0); mygc = XCreateGC (display, mywin, 0, 0); @@ -1485,6 +1507,11 @@ void handle_events (void) case Expose: refresh_necessary = 1; break; + case ClientMessage: + if (event.xclient.data.l[0]==delete_win) { + uae_quit (); + } + break; } } @@ -1826,16 +1853,38 @@ static void handle_inhibit (void) toggle_inhibit_frame (IHF_SCROLLLOCK); } +#include "gensound.h" +#include "sounddep/sound.h" +#include "events.h" +#include "audio.h" + +static void handle_interpol (void) +{ + if (sample_handler == sample16si_handler) { + sample_handler = sample16s_handler; + printf ("Interpol off\n"); + } + else if (sample_handler == sample16s_handler) { + sample_handler = sample16si_handler; + printf ("Interpol on\n"); + } + else if (sample_handler == sample16i_handler) + sample_handler = sample16_handler; + else if (sample_handler == sample16_handler) + sample_handler = sample16i_handler; + +} + static void framerate_up (void) { - if (currprefs.framerate < 20) - changed_prefs.framerate = currprefs.framerate + 1; + if (currprefs.gfx_framerate < 20) + changed_prefs.gfx_framerate = currprefs.gfx_framerate + 1; } static void framerate_down (void) { - if (currprefs.framerate > 1) - changed_prefs.framerate = currprefs.framerate - 1; + if (currprefs.gfx_framerate > 1) + changed_prefs.gfx_framerate = currprefs.gfx_framerate - 1; } static void handle_modeswitch (void)