557
557
g_object_class_install_property
559
PROP_OVERRIDE_COMMAND,
560
560
g_param_spec_boxed ("override-command", NULL, NULL,
562
562
G_PARAM_READWRITE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
1581
1581
TerminalScreenPrivate *priv = screen->priv;
1582
1582
gboolean (* button_press_event) (GtkWidget*, GdkEventButton*) =
1583
1583
GTK_WIDGET_CLASS (terminal_screen_parent_class)->button_press_event;
1584
int char_width, char_height, x, y, xpad, ypad;
1584
int char_width, char_height, row, col, xpad_total, ypad_total;
1585
1585
char *matched_string;
1586
1586
int matched_flavor = 0;
1589
1589
state = event->state & gtk_accelerator_get_default_mod_mask ();
1591
vte_terminal_get_padding (VTE_TERMINAL (screen), &xpad, &ypad);
1592
1591
terminal_screen_get_cell_size (screen, &char_width, &char_height);
1592
vte_terminal_get_padding (VTE_TERMINAL (screen), &xpad_total, &ypad_total);
1594
x = (event->x - xpad) / char_width;
1595
y = (event->y - ypad) / char_height;
1596
matched_string = terminal_screen_check_match (screen, x, y, &matched_flavor);
1594
row = (event->x - xpad_total / 2) / char_width;
1595
col = (event->y - ypad_total / 2) / char_height;
1596
matched_string = terminal_screen_check_match (screen, row, col, &matched_flavor);
1598
1598
if (matched_string != NULL &&
1599
1599
(event->button == 1 || event->button == 2) &&
1743
1743
g_return_val_if_fail (TERMINAL_IS_SCREEN (screen), NULL);
1745
1745
if (priv->pty_fd == -1)
1746
return priv->initial_working_directory;
1746
return g_strdup (priv->initial_working_directory);
1748
1748
/* Get the foreground process ID */
1749
1749
fgpid = tcgetpgrp (priv->pty_fd);
1750
1750
if (fgpid == -1)
1751
return priv->initial_working_directory;
1751
return g_strdup (priv->initial_working_directory);
1753
1753
/* Try to get the working directory using various OS-specific mechanisms */
1754
1754
for (i = 0; i < G_N_ELEMENTS (patterns); ++i)