Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
leolost2605 committed Apr 4, 2024
1 parent da2d2d0 commit 2088e9d
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/ScreenCast/Session.vala
Original file line number Diff line number Diff line change
Expand Up @@ -145,37 +145,31 @@ public class ScreenCast.Session : Object {
return false;
}

return yield setup_mutter_stream (path, VIRTUAL);
return yield setup_mutter_stream (path, WINDOW);
}

private async bool record_virtual () {
private async bool record_monitor (string connector) {
ObjectPath path;
try {
path = yield session.record_virtual (new HashTable<string, Variant> (str_hash, str_equal));
path = yield session.record_monitor (connector, new HashTable<string, Variant> (str_hash, str_equal));
} catch (Error e) {
warning ("Failed to record virtual: %s", e.message);
return false;
}

return yield setup_mutter_stream (path, VIRTUAL);
}

private async bool select_monitor () {
var monitor_tracker = new MonitorTracker ();
var monitor = monitor_tracker.monitors.get (0); //TODO
return yield record_monitor (monitor.connector);
return yield setup_mutter_stream (path, MONITOR);
}

private async bool record_monitor (string connector) {
private async bool record_virtual () {
ObjectPath path;
try {
path = yield session.record_monitor (connector, new HashTable<string, Variant> (str_hash, str_equal));
path = yield session.record_virtual (new HashTable<string, Variant> (str_hash, str_equal));
} catch (Error e) {
warning ("Failed to record virtual: %s", e.message);
return false;
}

return yield setup_mutter_stream (path, MONITOR);
return yield setup_mutter_stream (path, VIRTUAL);
}

private async bool setup_mutter_stream (ObjectPath proxy_path, SourceType source_type) {
Expand Down

0 comments on commit 2088e9d

Please sign in to comment.