~ubuntu-branches/ubuntu/trusty/gnome-shell/trusty-proposed

« back to all changes in this revision

Viewing changes to src/shell-screenshot.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-06-16 19:14:01 UTC
  • mfrom: (1.1.50) (19.1.37 experimental)
  • Revision ID: package-import@ubuntu.com-20130616191401-kef9vj3obfuvusrn
Tags: 3.8.3-1ubuntu1
* Merge with Debian. Remaining changes:
  - debian/control.in:
    + Build-depend on libsystemd-login-dev & libsystemd-daemon-dev
    + Depend on gdm instead of gdm3
  - debian/patches/40_change-pam-name-to-match-gdm.patch:
  - debian/patches/revert-suspend-break.patch:
    + Disabled, not needed on Ubuntu
  - debian/patches/ubuntu-lightdm-user-switching.patch:
    + Allow user switching when using LightDM.
  - debian/patches/ubuntu_lock_on_suspend.patch
    + Respect Ubuntu's lock-on-suspend setting.
      Disabled until it can be rewritten.
  - debian/patches/git_relock_screen_after_crash.patch:
    + Backport fix to ensure session is locked after crash
* debian/patches/revert-input-source-changes.patch:
  - Temporarily revert input source changes that need gnome-settings-daemon
    and gnome-control-center 3.8.3 to be useful
* debian/patches/revert-notification-settings-link.patch:
  - Don't link to Notification Settings since that's only available
    with gnome-control-center >= 3.8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#include "shell-global.h"
16
16
#include "shell-screenshot.h"
17
17
 
 
18
#define A11Y_APPS_SCHEMA "org.gnome.desktop.a11y.applications"
 
19
#define MAGNIFIER_ACTIVE_KEY "screen-magnifier-enabled"
 
20
 
18
21
struct _ShellScreenshotClass
19
22
{
20
23
  GObjectClass parent_class;
304
307
  MetaScreen *screen = shell_global_get_screen (screenshot_data->screenshot->global);
305
308
  int width, height;
306
309
  GSimpleAsyncResult *result;
 
310
  GSettings *settings;
307
311
 
308
312
  meta_screen_get_size (screen, &width, &height);
309
313
 
352
356
  screenshot_data->screenshot_area.width = width;
353
357
  screenshot_data->screenshot_area.height = height;
354
358
 
355
 
  if (screenshot_data->include_cursor)
 
359
  settings = g_settings_new (A11Y_APPS_SCHEMA);
 
360
  if (screenshot_data->include_cursor &&
 
361
      !g_settings_get_boolean (settings, MAGNIFIER_ACTIVE_KEY))
356
362
    _draw_cursor_image (screenshot_data->image, screenshot_data->screenshot_area);
 
363
  g_object_unref (settings);
357
364
 
358
365
  g_signal_handlers_disconnect_by_func (stage, (void *)grab_screenshot, (gpointer)screenshot_data);
359
366
 
476
483
                                    ShellScreenshotCallback callback)
477
484
{
478
485
  GSimpleAsyncResult *result;
 
486
  GSettings *settings;
479
487
 
480
488
  _screenshot_data *screenshot_data = g_new0 (_screenshot_data, 1);
481
489
 
492
500
  screenshot_data->filename = g_strdup (filename);
493
501
  screenshot_data->callback = callback;
494
502
 
 
503
  if (!window)
 
504
    {
 
505
      screenshot_data->filename_used = g_strdup ("");
 
506
      result = g_simple_async_result_new (NULL, on_screenshot_written, (gpointer)screenshot_data, shell_screenshot_screenshot_window);
 
507
      g_simple_async_result_set_op_res_gboolean (result, FALSE);
 
508
      g_simple_async_result_complete (result);
 
509
      g_object_unref (result);
 
510
 
 
511
      return;
 
512
    }
 
513
 
495
514
  window_actor = CLUTTER_ACTOR (meta_window_get_compositor_private (window));
496
515
  clutter_actor_get_position (window_actor, &actor_x, &actor_y);
497
516
 
522
541
  stex = META_SHAPED_TEXTURE (meta_window_actor_get_texture (META_WINDOW_ACTOR (window_actor)));
523
542
  screenshot_data->image = meta_shaped_texture_get_image (stex, &clip);
524
543
 
525
 
  if (include_cursor)
 
544
  settings = g_settings_new (A11Y_APPS_SCHEMA);
 
545
  if (include_cursor && !g_settings_get_boolean (settings, MAGNIFIER_ACTIVE_KEY))
526
546
    _draw_cursor_image (screenshot_data->image, screenshot_data->screenshot_area);
 
547
  g_object_unref (settings);
527
548
 
528
549
  result = g_simple_async_result_new (NULL, on_screenshot_written, (gpointer)screenshot_data, shell_screenshot_screenshot_window);
529
550
  g_simple_async_result_run_in_thread (result, write_screenshot_thread, G_PRIORITY_DEFAULT, NULL);