~ubuntu-branches/ubuntu/lucid/gnome-terminal/lucid-updates

« back to all changes in this revision

Viewing changes to src/terminal-screen.c

  • Committer: Bazaar Package Importer
  • Author(s): Pedro Fragoso
  • Date: 2009-03-16 10:59:29 UTC
  • mfrom: (1.3.29 upstream)
  • Revision ID: james.westby@ubuntu.com-20090316105929-enlra89b2bqog1w5
Tags: 2.26.0-0ubuntu1
* New upstream release (LP: #343715)
* debian/patches/30_SVNr3329_fix_memory_corruption.patch:
  - Removed, the change is in the tarball
* debian/patches/99_autoreconf.patch:
  - Refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
556
556
 
557
557
  g_object_class_install_property
558
558
    (object_class,
559
 
     PROP_ICON_TITLE,
 
559
     PROP_OVERRIDE_COMMAND,
560
560
     g_param_spec_boxed ("override-command", NULL, NULL,
561
561
                         G_TYPE_STRV,
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;
1587
1587
  guint state;
1588
1588
 
1589
1589
  state = event->state & gtk_accelerator_get_default_mod_mask ();
1590
1590
 
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);
1593
1593
 
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);
1597
1597
  
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);
1744
1744
 
1745
1745
  if (priv->pty_fd == -1)
1746
 
    return priv->initial_working_directory;
 
1746
    return g_strdup (priv->initial_working_directory);
1747
1747
 
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);
1752
1752
 
1753
1753
  /* Try to get the working directory using various OS-specific mechanisms */
1754
1754
  for (i = 0; i < G_N_ELEMENTS (patterns); ++i)
1788
1788
        }
1789
1789
    }
1790
1790
 
1791
 
  return priv->initial_working_directory;
 
1791
  return g_strdup (priv->initial_working_directory);
1792
1792
}
1793
1793
 
1794
1794
void