mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
[x11] Allow the window to be resized
There's no maximum size, but the minimum size is currently 32x20.
This commit is contained in:
parent
d149457241
commit
ef8b267826
1 changed files with 7 additions and 11 deletions
|
@ -188,6 +188,7 @@ configure_notify (XEvent *event)
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
IE_Send_Event (&ie_event);
|
IE_Send_Event (&ie_event);
|
||||||
|
VID_SetWindowSize (c->width, c->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
qboolean
|
qboolean
|
||||||
|
@ -519,7 +520,6 @@ X11_CreateWindow (int width, int height)
|
||||||
unsigned long mask;
|
unsigned long mask;
|
||||||
XSetWindowAttributes attr;
|
XSetWindowAttributes attr;
|
||||||
XClassHint *ClassHint;
|
XClassHint *ClassHint;
|
||||||
XSizeHints *SizeHints;
|
|
||||||
|
|
||||||
X11_AddEvent (ConfigureNotify, configure_notify);
|
X11_AddEvent (ConfigureNotify, configure_notify);
|
||||||
|
|
||||||
|
@ -540,17 +540,13 @@ X11_CreateWindow (int width, int height)
|
||||||
IN_X11_Postinit ();
|
IN_X11_Postinit ();
|
||||||
|
|
||||||
// Set window size hints
|
// Set window size hints
|
||||||
SizeHints = XAllocSizeHints ();
|
XSizeHints SizeHints = {
|
||||||
if (SizeHints) {
|
.flags = PMinSize,
|
||||||
SizeHints->flags = (PMinSize | PMaxSize);
|
.min_width = 32,
|
||||||
SizeHints->min_width = width;
|
.min_height = 20,
|
||||||
SizeHints->min_height = height;
|
};
|
||||||
SizeHints->max_width = width;
|
XSetWMNormalHints (x_disp, x_win, &SizeHints);
|
||||||
SizeHints->max_height = height;
|
|
||||||
XSetWMNormalHints (x_disp, x_win, SizeHints);
|
|
||||||
|
|
||||||
XFree (SizeHints);
|
|
||||||
}
|
|
||||||
// Set window title
|
// Set window title
|
||||||
X11_SetCaption (va (0, "%s", PACKAGE_STRING));
|
X11_SetCaption (va (0, "%s", PACKAGE_STRING));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue