Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not crash if display is unavailable #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

selurvedu
Copy link

@selurvedu selurvedu commented Jun 6, 2021

This allows running mconnect when a display is unavailable, e.g., when running as a systemd user service.

mconnect will output a warning, but will not crash.

--- output-with-display	2021-06-06 05:12:29.000000000 +0000
+++ output-without-display	2021-06-06 05:12:29.000000000 +0000
@@ -1,5 +1,9 @@
+Unable to init server: Could not connect: Connection refused
+Unable to init server: Could not connect: Connection refused
 ** Message: 00:00:00.000: config.vala:58: loaded configuration from /home/selurvedu/.config/mconnect/mconnect.conf
 
+** (mconnect:0): WARNING **: 00:00:00.000: mousepad.vala:41: failed to obtain display
+
 ** (mconnect:0): WARNING **: 00:00:00.000: devicemanager.vala:218: no handler for capability kdeconnect.runcommand
 
 ** (mconnect:0): WARNING **: 00:00:00.000: devicemanager.vala:218: no handler for capability kdeconnect.sftp.request

Of course, things like clipboard sharing and mouse control are not going to work, but sending files, forwarding notifications, controlling media, etc. will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant