~ubuntu-branches/ubuntu/oneiric/xfce4-terminal/oneiric

« back to all changes in this revision

Viewing changes to terminal/terminal-screen.c

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc
  • Date: 2011-01-30 18:02:08 UTC
  • mfrom: (1.3.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20110130180208-ivounjufdj1gjmog
Tags: 0.4.6-0ubuntu1
* New upstream release.
* Switch to 3.0 (quilt) source format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
356
356
  TerminalScreen *screen = TERMINAL_SCREEN (object);
357
357
  const gchar    *title = NULL;
358
358
  TerminalTitle   mode;
359
 
  gchar          *initial = NULL;
 
359
  gchar          *initial;
 
360
  gchar          *parsed_title = NULL;
360
361
  gchar          *custom_title;
361
362
 
362
363
  switch (prop_id)
381
382
            {
382
383
              /* show the initial title if the dynamic title is set to hidden */
383
384
              g_object_get (G_OBJECT (screen->preferences), "title-initial", &initial, NULL);
384
 
              title = initial;
 
385
              parsed_title = terminal_screen_parse_title (screen, initial);
 
386
              title = parsed_title;
 
387
              g_free (initial);
385
388
            }
386
389
          else if (G_LIKELY (screen->terminal != NULL))
387
390
            {
390
393
 
391
394
          /* TRANSLATORS: title for the tab/window used when all other
392
395
           * possible titles were empty strings */
393
 
          g_value_set_string (value, title != NULL ? title : _("Untitled"));
394
 
 
395
 
          g_free (initial);
 
396
          if (title == NULL || *title == '\0')
 
397
            title = _("Untitled");
 
398
 
 
399
          g_value_set_string (value, title);
 
400
 
 
401
          g_free (parsed_title);
396
402
        }
397
403
      break;
398
404
 
1213
1219
                                          screen->terminal->allocation.width,
1214
1220
                                          screen->terminal->allocation.height);
1215
1221
      vte_terminal_set_background_image (VTE_TERMINAL (screen->terminal), image);
1216
 
 
1217
1222
      if (G_LIKELY (image != NULL))
1218
1223
        g_object_unref (G_OBJECT (image));
1219
1224
      g_object_unref (G_OBJECT (loader));
1315
1320
void
1316
1321
terminal_screen_launch_child (TerminalScreen *screen)
1317
1322
{
1318
 
  gboolean update;
1319
 
  GError  *error = NULL;
1320
 
  gchar   *command;
1321
 
  gchar  **argv;
1322
 
  gchar  **env;
 
1323
  gboolean      update;
 
1324
  GError       *error = NULL;
 
1325
  gchar        *command;
 
1326
  gchar       **argv;
 
1327
  gchar       **env;
 
1328
#if VTE_CHECK_VERSION (0, 26, 0)
 
1329
  gchar       **argv2;
 
1330
  guint         i;
 
1331
  GSpawnFlags   spawn_flags = G_SPAWN_CHILD_INHERITS_STDIN | G_SPAWN_SEARCH_PATH;
 
1332
#endif
1323
1333
 
1324
1334
  terminal_return_if_fail (TERMINAL_IS_SCREEN (screen));
1325
1335
 
1339
1349
      g_object_get (G_OBJECT (screen->preferences),
1340
1350
                    "command-update-records", &update,
1341
1351
                    NULL);
1342
 
 
1343
1352
      env = terminal_screen_get_child_environment (screen);
1344
1353
 
 
1354
#if VTE_CHECK_VERSION (0, 26, 0)
 
1355
      argv2 = g_new0 (gchar *, g_strv_length (argv) + 2);
 
1356
      argv2[0] = command;
 
1357
 
 
1358
      if (argv != NULL)
 
1359
        {
 
1360
          for (i = 0; argv[i] != NULL; i++)
 
1361
            argv2[i + 1] = argv[i];
 
1362
 
 
1363
          spawn_flags |= G_SPAWN_FILE_AND_ARGV_ZERO;
 
1364
        }
 
1365
 
 
1366
      if (!vte_terminal_fork_command_full (VTE_TERMINAL (screen->terminal),
 
1367
                                           update ? VTE_PTY_DEFAULT : VTE_PTY_NO_LASTLOG | VTE_PTY_NO_UTMP | VTE_PTY_NO_WTMP,
 
1368
                                           screen->working_directory, argv2, env, 
 
1369
                                           spawn_flags,
 
1370
                                           NULL, NULL,
 
1371
                                           &screen->pid, &error))
 
1372
        {
 
1373
          terminal_dialogs_show_error (GTK_WIDGET (screen), error, _("Failed to execute child"));
 
1374
          g_error_free (error);
 
1375
        }
 
1376
 
 
1377
      g_free (argv2);
 
1378
#else
1345
1379
      screen->pid = vte_terminal_fork_command (VTE_TERMINAL (screen->terminal),
1346
1380
                                               command, argv, env,
1347
1381
                                               screen->working_directory,
1348
1382
                                               update, update, update);
 
1383
#endif
1349
1384
 
1350
1385
      g_strfreev (argv);
1351
1386
      g_strfreev (env);
1462
1497
 
1463
1498
#if VTE_CHECK_VERSION (0, 24, 0)
1464
1499
  gtk_widget_style_get (GTK_WIDGET (screen->terminal), "inner-border", &border, NULL);
1465
 
  xpad = border->left + border->right;
1466
 
  ypad = border->top + border->bottom;
 
1500
  if (border != NULL)
 
1501
    {
 
1502
      xpad = border->left + border->right;
 
1503
      ypad = border->top + border->bottom;
 
1504
      gtk_border_free (border);
 
1505
    }
 
1506
  else
 
1507
    {
 
1508
      xpad = ypad = 0;
 
1509
    }
1467
1510
#else
1468
1511
  vte_terminal_get_padding (VTE_TERMINAL (screen->terminal), &xpad, &ypad);
1469
1512
#endif