X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=vid_glx.c;h=8327b2608e9a8e301af2d7d27d0101c0e6a816fd;hb=1f0ca174b4805c9f14e53c02834b2a17fa01091b;hp=69155d1e9c8897e8f1511b7cb47a4cc5c0715bab;hpb=e32c37df7da8febe7fd6d5c97159b3fb01c14717;p=xonotic%2Fdarkplaces.git diff --git a/vid_glx.c b/vid_glx.c index 69155d1e..8327b260 100644 --- a/vid_glx.c +++ b/vid_glx.c @@ -284,6 +284,10 @@ static int XLateKey(XKeyEvent *ev, Uchar *ascii) case XK_KP_Subtract: key = K_KP_MINUS; break; case XK_KP_Divide: key = K_KP_SLASH; break; + case XK_Num_Lock: key = K_NUMLOCK; break; + case XK_Caps_Lock: key = K_CAPSLOCK; break; + case XK_Scroll_Lock: key = K_SCROLLOCK; break; + case XK_asciicircum: *ascii = key = '^'; break; // for some reason, XLookupString returns "" on this one for Grunt|2 case XK_section: *ascii = key = '~'; break; @@ -654,6 +658,15 @@ static void HandleEvents(void) // window changed size/location win_x = event.xconfigure.x; win_y = event.xconfigure.y; + // HACK on X11, we just request fullscreen mode, but + // cannot guess what the window manager will do for us + // exactly. That is why we read back the resolution we + // actually got here. + if(vid_isdesktopfullscreen) + { + desktop_mode.width = event.xconfigure.width; + desktop_mode.height = event.xconfigure.height; + } if((vid_resizable.integer < 2 || vid_isdesktopfullscreen) && (vid.width != event.xconfigure.width || vid.height != event.xconfigure.height)) { vid.width = event.xconfigure.width; @@ -663,19 +676,19 @@ static void HandleEvents(void) else Con_DPrintf("Updating to ConfigureNotify resolution %dx%d\n", vid.width, vid.height); - DPSOFTRAST_Flush(); - - if(vid.softdepthpixels) - free(vid.softdepthpixels); - - DestroyXImages(); - XSync(vidx11_display, False); - if(!BuildXImages(vid.width, vid.height)) - return; - XSync(vidx11_display, False); - - vid.softpixels = (unsigned int *) vidx11_ximage[vidx11_ximage_pos]->data; - vid.softdepthpixels = (unsigned int *)calloc(4, vid.width * vid.height); + if(vid.renderpath == RENDERPATH_SOFT) + { + DPSOFTRAST_Flush(); + if(vid.softdepthpixels) + free(vid.softdepthpixels); + DestroyXImages(); + XSync(vidx11_display, False); + if(!BuildXImages(vid.width, vid.height)) + return; + XSync(vidx11_display, False); + vid.softpixels = (unsigned int *) vidx11_ximage[vidx11_ximage_pos]->data; + vid.softdepthpixels = (unsigned int *)calloc(4, vid.width * vid.height); + } } break; case DestroyNotify: