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 "servermd.h"
#include "Xnest.h"
#include "xnest-xcb.h"
#include "Display.h"
@ -66,17 +65,31 @@ void
xnestQueryBestSize(int class, unsigned short *pWidth, unsigned short *pHeight,
ScreenPtr pScreen)
{
unsigned int width, height;
width = *pWidth;
height = *pHeight;
XQueryBestSize(xnestDisplay, class,
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],
width, height, &width, &height);
*pWidth,
*pHeight),
&err);
*pWidth = width;
*pHeight = height;
if (err) {
ErrorF("QueryBestSize request failed: %d\n", err->error_code);
free(err);
return;
}
if (!reply) {
ErrorF("QueryBestSize request failed: no reply\n");
return;
}
*pWidth = reply->width;
*pHeight = reply->height;
free(reply);
}
void