]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_glx.c
r_coronas_occlusionquery: don't try using a GL20-requiring feature in the GL11/GL13...
[xonotic/darkplaces.git] / vid_glx.c
index 69155d1e9c8897e8f1511b7cb47a4cc5c0715bab..8327b2608e9a8e301af2d7d27d0101c0e6a816fd 100644 (file)
--- 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: