aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drmtools.c1
-rw-r--r--fbcon.c14
-rw-r--r--logind.c38
3 files changed, 31 insertions, 22 deletions
diff --git a/drmtools.c b/drmtools.c
index 4f9295c..84dbbeb 100644
--- a/drmtools.c
+++ b/drmtools.c
@@ -224,7 +224,6 @@ static int drm_show_fb(struct drmfb *fb)
{
int rc;
- fprintf(stderr, "%s: fb %d\n", __func__, fb->id);
rc = drmModeSetCrtc(drm_fd, drm_enc->crtc_id, fb->id, 0, 0,
&drm_conn->connector_id, 1,
drm_mode);
diff --git a/fbcon.c b/fbcon.c
index e9f66bd..2ed9a43 100644
--- a/fbcon.c
+++ b/fbcon.c
@@ -179,17 +179,14 @@ static void cleanup_and_exit(int code)
static void console_switch_suspend(void)
{
- fprintf(stderr, "%s: start ...\n", __func__);
active = false;
gfx->suspend_display();
libinput_suspend(kbd);
logind_release_control();
- fprintf(stderr, "%s: ... done\n", __func__);
}
static void console_switch_resume(void)
{
- fprintf(stderr, "%s: start ...\n", __func__);
logind_take_control();
libinput_resume(kbd);
gfx->resume_display();
@@ -197,7 +194,6 @@ static void console_switch_resume(void)
state2.clear++;
dirty++;
active = true;
- fprintf(stderr, "%s: ... done\n", __func__);
}
/* ---------------------------------------------------------------------- */
@@ -442,13 +438,19 @@ static void fbcon_handle_keydown(struct xkb_state *state,
/* change font size */
if (ctrlalt && sym == XKB_KEY_plus) {
- font_size += 2;
+ if (font_size >= 20)
+ font_size += 4;
+ else
+ font_size += 2;
fbcon_resize();
fbcon_write_config();
return;
}
if (ctrlalt && sym == XKB_KEY_minus && font_size > 8) {
- font_size -= 2;
+ if (font_size > 20)
+ font_size -= 4;
+ else
+ font_size -= 2;
fbcon_resize();
fbcon_write_config();
return;
diff --git a/logind.c b/logind.c
index dec5670..506da59 100644
--- a/logind.c
+++ b/logind.c
@@ -23,6 +23,7 @@
/* ---------------------------------------------------------------------- */
+static int logind_debug = 0;
static sd_bus *logind_dbus = NULL;
static sd_bus_slot *logind_signals;
static const char *logind_session_path;
@@ -39,7 +40,8 @@ static void logind_pause_device_complete(unsigned int maj,
sd_bus_message *m = NULL;
int r;
- fprintf(stderr, "call : PauseDeviceComplete(%d,%d)\n", maj, min);
+ if (logind_debug)
+ fprintf(stderr, "call : PauseDeviceComplete(%d,%d)\n", maj, min);
r = sd_bus_call_method(logind_dbus,
"org.freedesktop.login1",
"/org/freedesktop/login1/session/self",
@@ -67,9 +69,6 @@ static int logind_prop_cb(sd_bus_message *m, void *data, sd_bus_error *ret_err)
char type;
int err;
- fprintf(stderr, "%s: %s\n", __func__,
- sd_bus_message_get_path(m));
-
err = sd_bus_message_read(m, "s", &intf);
if (err < 0)
return err;
@@ -91,14 +90,16 @@ static int logind_prop_cb(sd_bus_message *m, void *data, sd_bus_error *ret_err)
if (err < 0)
return err;
if (!active) {
- fprintf(stderr, "Active off (callback %s)\n",
- session_suspend ? "yes" : "no");
+ if (logind_debug)
+ fprintf(stderr, "prop : Active off (callback %s)\n",
+ session_suspend ? "yes" : "no");
if (session_suspend)
session_suspend();
}
if (active) {
- fprintf(stderr, "Active on (callback %s)\n",
- session_resume ? "yes" : "no");
+ if (logind_debug)
+ fprintf(stderr, "prop : Active on (callback %s)\n",
+ session_resume ? "yes" : "no");
if (session_resume)
session_resume();
}
@@ -136,7 +137,8 @@ static int logind_session_cb(sd_bus_message *m, void *data, sd_bus_error *ret_er
fprintf(stderr, "error : parsing PauseDevice msg failed\n");
return r;
}
- fprintf(stderr, "signal : %s(%d,%d,%s)\n", member, maj, min, type);
+ if (logind_debug)
+ fprintf(stderr, "signal : %s(%d,%d,%s)\n", member, maj, min, type);
if (strcmp(type, "pause") == 0)
logind_pause_device_complete(maj, min);
} else {
@@ -168,7 +170,8 @@ int logind_init(bool take_control,
}
session_id = getenv("XDG_SESSION_ID");
- fprintf(stderr, "call : GetSession(%s)\n", session_id);
+ if (logind_debug)
+ fprintf(stderr, "call : GetSession(%s)\n", session_id);
r = sd_bus_call_method(logind_dbus,
"org.freedesktop.login1",
"/org/freedesktop/login1",
@@ -248,7 +251,8 @@ int logind_switch_vt(int vt)
if (!logind_dbus)
return -1;
- fprintf(stderr, "call : SwitchTo(%d)\n", vt);
+ if (logind_debug)
+ fprintf(stderr, "call : SwitchTo(%d)\n", vt);
r = sd_bus_call_method(logind_dbus,
"org.freedesktop.login1",
"/org/freedesktop/login1/seat/self",
@@ -277,7 +281,8 @@ int logind_take_control(void)
if (!logind_dbus)
return -1;
- fprintf(stderr, "call : TakeControl()\n");
+ if (logind_debug)
+ fprintf(stderr, "call : TakeControl()\n");
r = sd_bus_call_method(logind_dbus,
"org.freedesktop.login1",
"/org/freedesktop/login1/session/self",
@@ -306,7 +311,8 @@ int logind_release_control(void)
if (!logind_dbus)
return -1;
- fprintf(stderr, "call : ReleaseControl()\n");
+ if (logind_debug)
+ fprintf(stderr, "call : ReleaseControl()\n");
r = sd_bus_call_method(logind_dbus,
"org.freedesktop.login1",
"/org/freedesktop/login1/session/self",
@@ -343,7 +349,8 @@ int logind_open(const char *path, int flags, void *user_data)
maj = major(st.st_rdev);
min = minor(st.st_rdev);
- fprintf(stderr, "call : TakeDevice(%d,%d)\n", maj, min);
+ if (logind_debug)
+ fprintf(stderr, "call : TakeDevice(%d,%d)\n", maj, min);
r = sd_bus_call_method(logind_dbus,
"org.freedesktop.login1",
"/org/freedesktop/login1/session/self",
@@ -398,7 +405,8 @@ void logind_close(int fd, void *user_data)
maj = major(st.st_rdev);
min = minor(st.st_rdev);
- fprintf(stderr, "call : ReleaseDevice(%d,%d)\n", maj, min);
+ if (logind_debug)
+ fprintf(stderr, "call : ReleaseDevice(%d,%d)\n", maj, min);
r = sd_bus_call_method(logind_dbus,
"org.freedesktop.login1",
"/org/freedesktop/login1/session/self",