summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorPeter Åstrand (astrand) <astrand@cendio.se>2018-03-19 11:07:32 +0100
committerPeter Åstrand (astrand) <astrand@cendio.se>2018-04-09 20:29:42 +0200
commit651faf8127276d6704f5ee5304586b66c89cc9b4 (patch)
tree3b6d40af6e4d7d47ee98351f6d3ef6b0a0477ba0 /unix
parent8fcf6cc65971ffe5384384c8fede568877e3a032 (diff)
downloadtigervnc-651faf8127276d6704f5ee5304586b66c89cc9b4.tar.gz
tigervnc-651faf8127276d6704f5ee5304586b66c89cc9b4.zip
Add debug log messages
Diffstat (limited to 'unix')
-rw-r--r--unix/common/randr.cxx39
1 files changed, 27 insertions, 12 deletions
diff --git a/unix/common/randr.cxx b/unix/common/randr.cxx
index 9cfc95dd..d37beb06 100644
--- a/unix/common/randr.cxx
+++ b/unix/common/randr.cxx
@@ -34,6 +34,8 @@ static rfb::LogWriter vlog("RandR");
static int ResizeScreen(int fb_width, int fb_height,
std::set<unsigned int>* disabledOutputs)
{
+ vlog.debug("Resizing screen framebuffer to %dx%d", fb_width, fb_height);
+
/*
* Disable outputs which are larger than the target size
*/
@@ -43,6 +45,9 @@ static int ResizeScreen(int fb_width, int fb_height,
if (x + width > fb_width || y + height > fb_height) {
/* Currently ignoring errors */
/* FIXME: Save output rotation and restore when configuring output */
+ char *name = vncRandRGetOutputName(i);
+ vlog.debug("Temporarily disabling output '%s'", name);
+ free(name);
vncRandRDisableOutput(i);
disabledOutputs->insert(vncRandRGetOutputId(i));
}
@@ -233,15 +238,19 @@ unsigned int setScreenLayout(int fb_width, int fb_height, const rfb::ScreenSet&
iter->dimensions.tl.y,
iter->dimensions.width(),
iter->dimensions.height());
- if (!ret) {
- char *name = vncRandRGetOutputName(i);
- vlog.error("Failed to reconfigure output '%s' to %dx%d+%d+%d",
- name,
+ char *name = vncRandRGetOutputName(i);
+ if (ret) {
+ vlog.debug("Reconfigured output '%s' to %dx%d+%d+%d", name,
+ iter->dimensions.width(), iter->dimensions.height(),
+ iter->dimensions.tl.x, iter->dimensions.tl.y);
+ } else {
+ vlog.error("Failed to reconfigure output '%s' to %dx%d+%d+%d", name,
iter->dimensions.width(), iter->dimensions.height(),
iter->dimensions.tl.x, iter->dimensions.tl.y);
free(name);
return rfb::resultInvalid;
}
+ free(name);
}
/* Allocate new outputs for new screens */
@@ -281,15 +290,19 @@ unsigned int setScreenLayout(int fb_width, int fb_height, const rfb::ScreenSet&
iter->dimensions.tl.y,
iter->dimensions.width(),
iter->dimensions.height());
- if (!ret) {
- char *name = vncRandRGetOutputName(i);
- vlog.error("Failed to reconfigure output '%s' to %dx%d+%d+%d",
- name,
+ char *name = vncRandRGetOutputName(i);
+ if (ret) {
+ vlog.debug("Reconfigured new output '%s' to %dx%d+%d+%d", name,
+ iter->dimensions.width(), iter->dimensions.height(),
+ iter->dimensions.tl.x, iter->dimensions.tl.y);
+ } else {
+ vlog.error("Failed to reconfigure new output '%s' to %dx%d+%d+%d", name,
iter->dimensions.width(), iter->dimensions.height(),
iter->dimensions.tl.x, iter->dimensions.tl.y);
free(name);
return rfb::resultInvalid;
}
+ free(name);
}
/* Turn off unused outputs */
@@ -306,13 +319,15 @@ unsigned int setScreenLayout(int fb_width, int fb_height, const rfb::ScreenSet&
/* Disable and move on... */
ret = vncRandRDisableOutput(i);
- if (!ret) {
- char *name = vncRandRGetOutputName(i);
- vlog.error("Failed to disable unused output '%s'",
- name);
+ char *name = vncRandRGetOutputName(i);
+ if (ret) {
+ vlog.debug("Disabled unused output '%s'", name);
+ } else {
+ vlog.error("Failed to disable unused output '%s'", name);
free(name);
return rfb::resultInvalid;
}
+ free(name);
}
/*