HYL_OK3568_LINUX/buildroot/package/frecon/0004-Add-hooks-for-term-switching.patch

42 lines
1.2 KiB
Diff
Raw Permalink Normal View History

2025-05-10 21:49:39 +08:00
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