Comment 5 for bug 316917

Revision history for this message
Mario Kemper (Romario) (mario-kemper) wrote :

@SaJeN: Thank you for your detailed investigation here.

The main problem is that there is no reliable way to get a notification when the window is hidden after triggering that. While the whole window manager stuff works in an asynchronous manner it also depends on many other circumstances (e.g. number of visible windows).
Of course we could check several compiz options to deal with that but there are many other window managers out there so a general solution would be better here. Additionally it would be very hard to do that because there are so much different compiz configurations out there.

In the last versions I've implemented just a silly "sleep <seconds>" statement with a fixed value to make sure the window really is hidden. The bad thing is that this strategy may confuse other users (without this problem) because they have to wait with no special reason. So i dropped it in version 0.64.

As GScrot is written in Perl you can easily put that statement back in place if you want to:

Take an editor of your choice and edit the /usr/bin/gscrot file:
sudo gedit /usr/bin/gscrot

Go to line 1702 and change the codeblock....
 #hide mainwindow
 if ( $hide_active->get_active
  && ( $data ne "web" && $data ne "tray_web" )
  && !$is_in_tray
  && !$selfcapture )
 {
  $window->iconify;
  $window->hide;
  Gtk2::Gdk->flush;
  $is_in_tray = TRUE;
 }

to this one for example:

 #hide mainwindow
 if ( $hide_active->get_active
  && ( $data ne "web" && $data ne "tray_web" )
  && !$is_in_tray
  && !$selfcapture )
 {
  $window->iconify;
  $window->hide;
  Gtk2::Gdk->flush;
                sleep 1;
  $is_in_tray = TRUE;
 }

You can even change the sleep value (only integers are allowed here).

Maybe we will find any better solution to this in the future or we should just make this configurable via GScrot>>Preferences.

Greetings
Mario