~ubuntu-branches/debian/jessie/shutter/jessie

« back to all changes in this revision

Viewing changes to share/shutter/resources/modules/Shutter/Screenshot/Workspace.pm

  • Committer: Bazaar Package Importer
  • Author(s): Ryan Niebur
  • Date: 2009-12-24 21:47:06 UTC
  • mfrom: (1.2.3 upstream) (2.2.2 squeeze)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20091224214706-c2ve4k7anyqhzvr1
* New Upstream Version
* update and change some deps
* update email address
* set Standards-Version to 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
sub new {
44
44
        my $class = shift;
45
45
 
46
 
        #call constructor of super class (shutter_common, include_cursor, delay)
47
 
        my $self = $class->SUPER::new( shift, shift, shift );
 
46
        #call constructor of super class (shutter_common, include_cursor, delay, notify_timeout)
 
47
        my $self = $class->SUPER::new( shift, shift, shift, shift );
48
48
 
49
49
        $self->{_selected_workspace}   = shift;
50
50
        $self->{_vpx}                  = shift;
74
74
        #valid workspace?
75
75
        return TRUE unless $active_workspace;
76
76
        
77
 
        $self->{_wsp_name} = $active_workspace->get_name;
78
 
        utf8::encode $self->{_wsp_name};
79
77
        my $active_vpx = $active_workspace->get_viewport_x;
80
78
        my $active_vpy = $active_workspace->get_viewport_y;
81
79
 
86
84
                        if (   $self->{_selected_workspace} == $space->get_number
87
85
                                && $self->{_selected_workspace} != $active_workspace->get_number )
88
86
                        {
89
 
                                $space->activate(time);
90
 
                                $self->{_wsp_name} = $space->get_name;
 
87
                                $space->activate(Gtk2->get_current_event_time);
91
88
                                $wrksp_changed = TRUE;
92
89
                        }
93
90
                }
106
103
        }
107
104
 
108
105
        my $output = undef;
109
 
        if ( $self->{_current_monitor_only} ) {
 
106
        if ( $self->{_current_monitor_only} || $self->{_gdk_screen}->get_n_monitors <= 1) {
110
107
                ($output) = $self->get_pixbuf_from_drawable(
111
108
                                                $self->get_root_and_current_monitor_geometry
112
109
                                        );
 
110
 
 
111
        #When there are multiple monitors with different resolutions, the visible area
 
112
        #within the root window may not be rectangular (it may have an L-shape, for
 
113
        #example). In that case, mask out the areas of the root window which would
 
114
        #not be visible in the monitors, so that screenshot do not end up with content
 
115
        #that the user won't ever see.
 
116
        #
 
117
        #comment copied from gnome-screenshot
 
118
        #http://svn.gnome.org/viewvc/gnome-utils/trunk/gnome-screenshot/screenshot-utils.c?view=markup                                  
113
119
        } elsif($self->{_gdk_screen}->get_n_monitors > 1) {
114
120
                ($output) = $self->get_pixbuf_from_drawable(
115
121
                                                $self->get_root_and_geometry,
116
 
                                                TRUE
 
122
                                                $self->get_monitor_region
117
123
                                        );                                      
118
 
        }else{
119
 
                ($output) = $self->get_pixbuf_from_drawable(
120
 
                                                $self->get_root_and_geometry,
121
 
                                                FALSE
122
 
                                        );                      
 
124
        }
 
125
 
 
126
        #set name of the captured workspace
 
127
        #e.g. for use in wildcards
 
128
        if($output =~ /Gtk2/){
 
129
                $output->{'name'} = $self->{_wnck_screen}->get_active_workspace->get_name;
123
130
        }
124
131
 
125
132
        #metacity etc
126
133
        if ( $self->{_selected_workspace} ) {
127
 
                $active_workspace->activate(time) if $wrksp_changed;
 
134
                $active_workspace->activate(Gtk2->get_current_event_time) if $wrksp_changed;
128
135
        #compiz
129
136
        } else {
130
137
                $self->{_wnck_screen}->move_viewport( $active_vpx, $active_vpy );