Add proper fullscreen and resolution changing support using XRandR. This makes XRandR mandatory, but I don't see any reason why we can't do that, and providing alternatives would be difficult at best for little payoff.

This commit is contained in:
Ben Anderson
2005-12-02 21:17:36 +00:00
parent 60bdd7ae04
commit 7da3272486
5 changed files with 127 additions and 15 deletions
+16 -5
View File
@@ -1,7 +1,7 @@
#include "global.h"
#include "X11Helper.h"
#include <X11/Xlib.h> // Display, Window
#include <X11/Xlib.h>
#include "RageLog.h"
#include "RageDisplay.h"
@@ -86,7 +86,7 @@ static bool pApplyMasks()
return true;
}
bool X11Helper::MakeWindow( int screenNum, int depth, Visual *visual, int width, int height )
bool X11Helper::MakeWindow( int screenNum, int depth, Visual *visual, int width, int height, bool overrideRedirect )
{
vector<long>::iterator i;
@@ -116,9 +116,20 @@ bool X11Helper::MakeWindow( int screenNum, int depth, Visual *visual, int width,
winAttribs.colormap = XCreateColormap( Dpy, RootWindow(Dpy, screenNum), visual, AllocNone );
Win = XCreateWindow( Dpy, RootWindow(Dpy, screenNum), 0, 0, width,
height, 0, depth, InputOutput, visual,
CWBorderPixel | CWColormap | CWEventMask, &winAttribs );
if( overrideRedirect )
{
winAttribs.override_redirect = True;
Win = XCreateWindow( Dpy, RootWindow(Dpy, screenNum), 0, 0, width,
height, 0, depth, InputOutput, visual,
CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect, &winAttribs );
}
else
{
Win = XCreateWindow( Dpy, RootWindow(Dpy, screenNum), 0, 0, width,
height, 0, depth, InputOutput, visual,
CWBorderPixel | CWColormap | CWEventMask, &winAttribs );
}
g_bHaveWin = true;
+2 -1
View File
@@ -26,8 +26,9 @@ namespace X11Helper
// (Re)create the window on the screen of this number with this depth,
// this visual type, this width (optional -- you can resize the window
// in your callback later), and this height (optional).
// Also, whether to enable override redirect on the window.
bool MakeWindow(int screenNum, int depth, Visual *visual,
int width=32, int height=32);
int width=32, int height=32, bool overrideRedirect=false);
// Unmask one X event type mask thingy (XSelectInput() arg 3) on the
// current window. Masked/unmasked events will carry between windows.