Xnest: replace XQueryBestSize() by xcb_query_best_size()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
115a7ceb23
commit
2ed4c16b36
|
@ -31,7 +31,6 @@ is" without express or implied warranty.
|
||||||
#include "region.h"
|
#include "region.h"
|
||||||
#include "servermd.h"
|
#include "servermd.h"
|
||||||
|
|
||||||
#include "Xnest.h"
|
|
||||||
#include "xnest-xcb.h"
|
#include "xnest-xcb.h"
|
||||||
|
|
||||||
#include "Display.h"
|
#include "Display.h"
|
||||||
|
@ -66,17 +65,31 @@ void
|
||||||
xnestQueryBestSize(int class, unsigned short *pWidth, unsigned short *pHeight,
|
xnestQueryBestSize(int class, unsigned short *pWidth, unsigned short *pHeight,
|
||||||
ScreenPtr pScreen)
|
ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
unsigned int width, height;
|
xcb_generic_error_t *err = NULL;
|
||||||
|
xcb_query_best_size_reply_t *reply = xcb_query_best_size_reply(
|
||||||
|
xnestUpstreamInfo.conn,
|
||||||
|
xcb_query_best_size(
|
||||||
|
xnestUpstreamInfo.conn,
|
||||||
|
class,
|
||||||
|
xnestDefaultWindows[pScreen->myNum],
|
||||||
|
*pWidth,
|
||||||
|
*pHeight),
|
||||||
|
&err);
|
||||||
|
|
||||||
width = *pWidth;
|
if (err) {
|
||||||
height = *pHeight;
|
ErrorF("QueryBestSize request failed: %d\n", err->error_code);
|
||||||
|
free(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
XQueryBestSize(xnestDisplay, class,
|
if (!reply) {
|
||||||
xnestDefaultWindows[pScreen->myNum],
|
ErrorF("QueryBestSize request failed: no reply\n");
|
||||||
width, height, &width, &height);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
*pWidth = width;
|
*pWidth = reply->width;
|
||||||
*pHeight = height;
|
*pHeight = reply->height;
|
||||||
|
free(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue