// window changed size/location
win_x = event.xconfigure.x;
win_y = event.xconfigure.y;
- if(vid_resizable.integer < 2)
+ if(vid_resizable.integer < 2 || vid_isnetwmfullscreen)
{
vid.width = event.xconfigure.width;
vid.height = event.xconfigure.height;
+ if(vid_isnetwmfullscreen)
+ Con_Printf("NetWM fullscreen: actually using resolution %dx%d\n", vid.width, vid.height);
+ else
+ Con_DPrintf("Updating to ConfigureNotify resolution %dx%d\n", vid.width, vid.height);
}
break;
case DestroyNotify:
*attrib++ = None;
}
-int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate, int stereobuffer, int samples)
+int VID_InitMode(int fullscreen, int *width, int *height, int bpp, int refreshrate, int stereobuffer, int samples)
{
int i;
int attrib[32];
vid_isnetwmfullscreen = true;
vid_isfullscreen = true;
// width and height will be filled in later
+ Con_DPrintf("Using NetWM fullscreen mode\n");
}
if(!vid_isfullscreen && vidmode_ext)
for (i = 0; i < num_vidmodes; i++)
{
- if (width > vidmodes[i]->hdisplay || height > vidmodes[i]->vdisplay)
+ if (*width > vidmodes[i]->hdisplay || *height > vidmodes[i]->vdisplay)
continue;
- x = width - vidmodes[i]->hdisplay;
- y = height - vidmodes[i]->vdisplay;
+ x = *width - vidmodes[i]->hdisplay;
+ y = *height - vidmodes[i]->vdisplay;
dist = (x * x) + (y * y);
if (best_fit == -1 || dist < best_dist)
{
// LordHavoc: changed from ActualWidth/ActualHeight =,
// to width/height =, so the window will take the full area of
// the mode chosen
- width = vidmodes[best_fit]->hdisplay;
- height = vidmodes[best_fit]->vdisplay;
+ *width = vidmodes[best_fit]->hdisplay;
+ *height = vidmodes[best_fit]->vdisplay;
// change to the mode
XF86VidModeSwitchToMode(vidx11_display, vidx11_screen, vidmodes[best_fit]);
// Move the viewport to top left
XF86VidModeSetViewPort(vidx11_display, vidx11_screen, 0, 0);
+ Con_DPrintf("Using XVidMode fullscreen mode at %dx%d\n", *width, *height);
}
free(vidmodes);
// use the full desktop resolution
vid_isfullscreen = true;
// width and height will be filled in later
- width = DisplayWidth(vidx11_display, vidx11_screen);
- height = DisplayHeight(vidx11_display, vidx11_screen);
+ *width = DisplayWidth(vidx11_display, vidx11_screen);
+ *height = DisplayHeight(vidx11_display, vidx11_screen);
+ Con_DPrintf("Using X11 fullscreen mode at %dx%d\n", *width, *height);
}
}
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
}
- win = XCreateWindow(vidx11_display, root, 0, 0, width, height, 0, visinfo->depth, InputOutput, visinfo->visual, mask, &attr);
+ win = XCreateWindow(vidx11_display, root, 0, 0, *width, *height, 0, visinfo->depth, InputOutput, visinfo->visual, mask, &attr);
wmhints = XAllocWMHints();
if(XpmCreatePixmapFromData(vidx11_display, win,
szhints = XAllocSizeHints();
if(vid_resizable.integer == 0 && !vid_isnetwmfullscreen)
{
- szhints->min_width = szhints->max_width = width;
- szhints->min_height = szhints->max_height = height;
+ szhints->min_width = szhints->max_width = *width;
+ szhints->min_height = szhints->max_height = *height;
szhints->flags |= PMinSize | PMaxSize;
}
if (!vid_x11_dgasupported)
Con_Print( "Failed to detect XF86DGA Mouse extension\n" );
#endif
+
GL_Init();
return true;
}