Commit 90c72956 authored by Erik Reider's avatar Erik Reider

Print every monitors information for debugging

parent bd59da4b
......@@ -434,6 +434,7 @@ namespace SwayNotificationCenter {
}
public void set_monitor (Gdk.Monitor ?monitor) {
debug ("Setting monitor for ControlCenter: %s", Functions.monitor_to_string (monitor));
this.monitor_name = monitor == null ? null : monitor.connector;
GtkLayerShell.set_monitor (this, monitor);
}
......
......@@ -409,5 +409,16 @@ namespace SwayNotificationCenter {
return null;
}
public static string ?monitor_to_string (Gdk.Monitor ?monitor) {
if (monitor == null) {
return null;
}
return "%s, %ix%i, x:%i y:%i, scale:%f\n".printf (
monitor.get_description (),
monitor.geometry.width, monitor.geometry.height,
monitor.geometry.x, monitor.geometry.y,
monitor.scale);
}
}
}
......@@ -70,6 +70,9 @@ namespace SwayNotificationCenter {
error ("Could not get Display!");
}
monitors = display.get_monitors ();
assert_nonnull (monitors);
print_monitors ();
swaync_daemon = new SwayncDaemon ();
Bus.own_name (BusType.SESSION, "org.erikreider.swaync.cc",
......@@ -85,6 +88,19 @@ namespace SwayNotificationCenter {
add_window (swaync_daemon.noti_daemon.control_center);
}
private void print_monitors () {
uint num_monitors = monitors.get_n_items ();
string monitors_string = "";
for (uint i = 0; i < num_monitors; i++) {
Gdk.Monitor ?mon = (Gdk.Monitor) monitors.get_item (i);
if (mon == null) {
continue;
}
monitors_string += Functions.monitor_to_string (mon);
}
info ("Monitors:\n%s", monitors_string);
}
void on_cc_bus_aquired (DBusConnection conn) {
try {
conn.register_object ("/org/erikreider/swaync/cc", swaync_daemon);
......
......@@ -330,6 +330,7 @@ namespace SwayNotificationCenter {
}
// Display a new notification if the old one isn't visible
debug ("Could not find floating notification to replace: %u", id);
add_notification (new_params);
}
......@@ -355,6 +356,7 @@ namespace SwayNotificationCenter {
}
public void set_monitor (Gdk.Monitor ?monitor) {
debug ("Setting monitor for ControlCenter: %s", Functions.monitor_to_string (monitor));
NotificationWindow.monitor_name = monitor == null ? null : monitor.connector;
GtkLayerShell.set_monitor (this, monitor);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment