gtk: Remove unnecessary C4Window::wnd

It was only used to specify a screen for randr, which doesn't need a
particular window.
objectmenu
Günther Brammer 2016-01-22 22:22:36 +01:00
parent 93f12150c4
commit 8f48f0275d
3 changed files with 7 additions and 22 deletions

View File

@ -141,7 +141,7 @@ bool C4AbstractApp::SetVideoMode(int iXRes, int iYRes, unsigned int iColorDepth,
if (Priv->xrandr_major_version >= 0 && !(iXRes == -1 && iYRes == -1))
{
// randr spec says to always get fresh info, so don't cache.
XRRScreenConfiguration * conf = XRRGetScreenInfo (dpy, pWindow->wnd);
XRRScreenConfiguration * conf = XRRGetScreenInfo (dpy, pWindow->renderwnd);
if (Priv->xrandr_oldmode == -1)
Priv->xrandr_oldmode = XRRConfigCurrentConfiguration (conf, &Priv->xrandr_rot);
int n;
@ -153,7 +153,7 @@ bool C4AbstractApp::SetVideoMode(int iXRes, int iYRes, unsigned int iColorDepth,
#ifdef _DEBUG
LogF("XRRSetScreenConfig %d", i);
#endif
fDspModeSet = XRRSetScreenConfig(dpy, conf, pWindow->wnd, i, Priv->xrandr_rot, CurrentTime) == RRSetConfigSuccess;
fDspModeSet = XRRSetScreenConfig(dpy, conf, pWindow->renderwnd, i, Priv->xrandr_rot, CurrentTime) == RRSetConfigSuccess;
break;
}
}
@ -169,11 +169,11 @@ void C4AbstractApp::RestoreVideoMode()
Display * const dpy = gdk_x11_display_get_xdisplay(gdk_display_get_default());
if (fDspModeSet && Priv->xrandr_major_version >= 0 && Priv->xrandr_oldmode != -1)
{
XRRScreenConfiguration * conf = XRRGetScreenInfo (dpy, pWindow->wnd);
XRRScreenConfiguration * conf = XRRGetScreenInfo (dpy, pWindow->renderwnd);
#ifdef _DEBUG
LogF("XRRSetScreenConfig %d (back)", Priv->xrandr_oldmode);
#endif
XRRSetScreenConfig (dpy, conf, pWindow->wnd, Priv->xrandr_oldmode, Priv->xrandr_rot, CurrentTime);
XRRSetScreenConfig (dpy, conf, pWindow->renderwnd, Priv->xrandr_oldmode, Priv->xrandr_rot, CurrentTime);
Priv->xrandr_oldmode = -1;
XRRFreeScreenConfigInfo(conf);
fDspModeSet = false;
@ -225,20 +225,6 @@ bool C4AbstractApp::IsClipboardFull(bool fClipboard)
return gtk_clipboard_wait_is_text_available(gtk_clipboard_get(fClipboard ? GDK_SELECTION_CLIPBOARD : GDK_SELECTION_PRIMARY));
}
#if 0
void C4AbstractApp::OnXInput()
{
while (XEventsQueued(dpy, QueuedAfterReading))
{
HandleXMessage();
}
// At least the _NET_WM_PING reply needs to be flushed,
// and having received events is a good heuristic for
// having issued X11 commands, even if most events
// are mouse moves that don't generate X11 commands.
XFlush(dpy);
}
#endif
void C4AbstractApp::MessageDialog(const char * message)
{
GtkWidget * dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", message);

View File

@ -341,7 +341,6 @@ public:
protected:
bool FindFBConfig(int samples, GLXFBConfig *info);
unsigned long wnd;
unsigned long renderwnd;
// The GLXFBConfig the window was created with
GLXFBConfig Info;

View File

@ -533,7 +533,8 @@ static gboolean OnConfigureGD(GtkWidget* widget, GdkEventConfigure* event, gpoin
}
C4Window::C4Window ():
Active(false), pSurface(0), wnd(0), renderwnd(0), Info(0), window(NULL)
Active(false), pSurface(0),
renderwnd(0), Info(0), window(NULL)
{
}
@ -768,7 +769,6 @@ C4Window* C4Window::Init(WindowKind windowKind, C4AbstractApp * pApp, const char
// Wait until window is mapped to get the window's XID
gtk_widget_show_now(GTK_WIDGET(window));
wnd = GDK_WINDOW_XID(window_wnd);
if (GTK_IS_LAYOUT(render_widget))
{
@ -859,7 +859,7 @@ void C4Window::Clear()
}
// Avoid that the base class tries to free these
wnd = renderwnd = 0;
renderwnd = 0;
window = NULL;
Active = false;