42 lines
1.2 KiB
Diff
42 lines
1.2 KiB
Diff
From a53f23b63f94f32a55483ba49e23e06726d38e1f Mon Sep 17 00:00:00 2001
|
|
From: Jeffy Chen <jeffy.chen@rock-chips.com>
|
|
Date: Fri, 10 Jun 2022 11:44:04 +0800
|
|
Subject: [PATCH 4/9] Add hooks for term switching
|
|
|
|
term foreground: /etc/frecon/term-switch on
|
|
term background: /etc/frecon/term-switch off
|
|
|
|
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
|
|
---
|
|
term.c | 7 +++++++
|
|
1 file changed, 7 insertions(+)
|
|
|
|
diff --git a/term.c b/term.c
|
|
index 7b6383a..8f391ef 100644
|
|
--- a/term.c
|
|
+++ b/term.c
|
|
@@ -1013,6 +1013,10 @@ void term_background(bool onetry)
|
|
if (in_background)
|
|
return;
|
|
in_background = true;
|
|
+
|
|
+ if (system("/etc/frecon/term-switch off") < 0)
|
|
+ LOG(DEBUG, "Failed to exec hook script.");
|
|
+
|
|
drm_dropmaster(NULL);
|
|
while (!dbus_take_display_ownership() && retry--) {
|
|
if (onetry)
|
|
@@ -1033,6 +1037,9 @@ void term_foreground(void)
|
|
return;
|
|
in_background = false;
|
|
|
|
+ if (system("/etc/frecon/term-switch on") < 0)
|
|
+ LOG(DEBUG, "Failed to exec hook script.");
|
|
+
|
|
/* LOG(INFO, "TIMING: Console switch time start."); */ /* Keep around for timing it in the future. */
|
|
while (!dbus_release_display_ownership() && retry--) {
|
|
LOG(ERROR, "Chrome did not release master. %s",
|
|
--
|
|
2.20.1
|
|
|