aboutsummaryrefslogtreecommitdiffstats
path: root/src/servers/crtc.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-18 14:21:00 +0200
committerMattias Andrée <maandree@kth.se>2016-07-18 14:21:00 +0200
commit9c936e1d434becca2396d7c4e4ee2f0655fbb973 (patch)
tree95d16e773f0025b1b83b93ffbe70843d90a0a116 /src/servers/crtc.c
parentm + do state merge in servers/crtc.c (diff)
downloadcoopgammad-9c936e1d434becca2396d7c4e4ee2f0655fbb973.tar.gz
coopgammad-9c936e1d434becca2396d7c4e4ee2f0655fbb973.tar.bz2
coopgammad-9c936e1d434becca2396d7c4e4ee2f0655fbb973.tar.xz
Move disconnect and reconnect to servers/crtc.c, but keep gamma reapplication in servers/gamma.c
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'src/servers/crtc.c')
-rw-r--r--src/servers/crtc.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/servers/crtc.c b/src/servers/crtc.c
index 5b3af43..41056bf 100644
--- a/src/servers/crtc.c
+++ b/src/servers/crtc.c
@@ -16,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "crtc.h"
+#include "gamma.h"
#include "../state.h"
#include "../communication.h"
@@ -195,3 +196,35 @@ int merge_state(struct output* restrict old_outputs, size_t old_outputs_n)
return 0;
}
+
+
+/**
+ * Disconnect from the site
+ *
+ * @return Zero on success, -1 on error
+ */
+int disconnect(void)
+{
+ if (!connected)
+ return 0;
+
+ connected = 0;
+ return 0; /* TODO disconnect() */
+}
+
+
+/**
+ * Reconnect to the site
+ *
+ * @return Zero on success, -1 on error
+ */
+int reconnect(void)
+{
+ if (connected)
+ return 0;
+
+ connected = 1;
+ reapply_gamma();
+ return 0; /* TODO reconnect() */
+}
+