#define __RFB_SCREENSET_INCLUDED__
#include <stdio.h>
+#include <string.h>
#include <rdr/types.h>
#include <rfb/Rect.h>
return true;
};
- inline void debug_print(void) const {
+ inline void print(char* str, size_t len) const {
+ char buffer[128];
std::list<Screen>::const_iterator iter;
- fprintf(stderr, "%d screens\n", num_screens());
+ snprintf(buffer, sizeof(buffer), "%d screen(s)\n", num_screens());
+ str[0] = '\0';
+ strncat(str, buffer, len - 1 - strlen(str));
for (iter = screens.begin();iter != screens.end();++iter) {
- fprintf(stderr, " %10d (0x%08x): %dx%d+%d+%d (flags 0x%08x)\n",
- (int)iter->id, (unsigned)iter->id,
- iter->dimensions.width(), iter->dimensions.height(),
- iter->dimensions.tl.x, iter->dimensions.tl.y,
- (unsigned)iter->flags);
+ snprintf(buffer, sizeof(buffer),
+ " %10d (0x%08x): %dx%d+%d+%d (flags 0x%08x)\n",
+ (int)iter->id, (unsigned)iter->id,
+ iter->dimensions.width(), iter->dimensions.height(),
+ iter->dimensions.tl.x, iter->dimensions.tl.y,
+ (unsigned)iter->flags);
+ strncat(str, buffer, len - 1 - strlen(str));
}
};
if (vncRandRGetOutputCount(screenIndex) == 0)
return rfb::resultProhibited;
+ char buffer[2048];
+ vlog.debug("Got request for framebuffer resize to %dx%d",
+ fb_width, fb_height);
+ layout.print(buffer, sizeof(buffer));
+ vlog.debug("%s", buffer);
+
/*
* First check that we don't have any active clone modes. That's just
* too messy to deal with.
/* Try to create more outputs if needed... (only works on Xvnc) */
if (layout.num_screens() > availableOutputs) {
+ vlog.debug("Insufficient screens. Need to create %d more.",
+ layout.num_screens() - availableOutputs);
ret = vncRandRCreateOutputs(screenIndex,
layout.num_screens() - availableOutputs);
if (ret < 0) {
(layout == cc->cp.screenLayout))
return;
- vlog.debug("Requesting framebuffer resize from %dx%d to %dx%d (%d screens)",
- cc->cp.width, cc->cp.height, width, height, layout.num_screens());
+ char buffer[2048];
+ vlog.debug("Requesting framebuffer resize from %dx%d to %dx%d",
+ cc->cp.width, cc->cp.height, width, height);
+ layout.print(buffer, sizeof(buffer));
+ vlog.debug("%s", buffer);
if (!layout.validate(width, height)) {
vlog.error(_("Invalid screen layout computed for resize request!"));