Xnest: replace XQueryBestSize() by xcb_query_best_size()

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-08-20 08:53:20 +02:00
parent 115a7ceb23
commit 2ed4c16b36

View File

@ -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