summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2016-11-18 01:21:04 +0100
committerZenWalker <[email protected]>2016-11-18 01:21:04 +0100
commitd4234710b56581f862c9f0286055028237235ea1 (patch)
treeea36bad85a77f840264f5c83061af425e194b69c /src
parent3557b4207a47974bdb58816e5e78f9d15af5604f (diff)
downloadmate-terminal-d4234710b56581f862c9f0286055028237235ea1.tar.bz2
mate-terminal-d4234710b56581f862c9f0286055028237235ea1.tar.xz
screen: Update for vte API
Fixes partially #149 https://git.gnome.org/browse/gnome-terminal/commit/?id=b9cf035874e06951ff8425760cf978ca412b2032
Diffstat (limited to 'src')
-rw-r--r--src/terminal-screen.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index 69ede6f..0f7f33d 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -65,7 +65,6 @@ struct _TerminalScreenPrivate
char **initial_env;
char **override_command;
int child_pid;
- int pty_fd;
double font_scale;
gboolean user_title; /* title was manually set */
GSList *match_tags;
@@ -341,7 +340,6 @@ terminal_screen_init (TerminalScreen *screen)
vte_terminal_set_mouse_autohide (VTE_TERMINAL (screen), TRUE);
priv->child_pid = -1;
- priv->pty_fd = -1;
priv->font_scale = PANGO_SCALE_MEDIUM;
@@ -1480,7 +1478,6 @@ terminal_screen_launch_child_cb (TerminalScreen *screen)
}
priv->child_pid = pid;
- priv->pty_fd = vte_terminal_get_pty (terminal);
g_free (shell);
g_strfreev (argv);
@@ -1714,8 +1711,10 @@ terminal_screen_get_current_dir (TerminalScreen *screen)
{
TerminalScreenPrivate *priv = screen->priv;
char *cwd;
+ VtePty *pty;
- if (priv->pty_fd != -1)
+ pty = vte_terminal_get_pty (VTE_TERMINAL (screen));
+ if (pty != NULL)
{
#if 0
/* Get the foreground process ID */
@@ -1747,9 +1746,11 @@ terminal_screen_get_current_dir (TerminalScreen *screen)
char*
terminal_screen_get_current_dir_with_fallback (TerminalScreen *screen)
{
+ VtePty *pty;
TerminalScreenPrivate *priv = screen->priv;
- if (priv->pty_fd == -1)
+ pty = vte_terminal_get_pty (VTE_TERMINAL (screen));
+ if (pty == NULL)
return g_strdup (priv->initial_working_directory);
return terminal_screen_get_current_dir (screen);
@@ -1817,7 +1818,6 @@ terminal_screen_child_exited (VteTerminal *terminal, int status)
screen);
priv->child_pid = -1;
- priv->pty_fd = -1;
action = terminal_profile_get_property_enum (priv->profile, TERMINAL_PROFILE_EXIT_ACTION);
@@ -2271,12 +2271,19 @@ gboolean
terminal_screen_has_foreground_process (TerminalScreen *screen)
{
TerminalScreenPrivate *priv = screen->priv;
+ VtePty *pty;
+ int fd;
int fgpid;
- if (priv->pty_fd == -1)
+ pty = vte_terminal_get_pty (VTE_TERMINAL (screen));
+ if (pty == NULL)
return FALSE;
- fgpid = tcgetpgrp (priv->pty_fd);
+ fd = vte_pty_get_fd (pty);
+ if (fd == -1)
+ return FALSE;
+
+ fgpid = tcgetpgrp (fd);
if (fgpid == -1 || fgpid == priv->child_pid)
return FALSE;