Screenshoot menu stay's visible with compiz

Bug #316917 reported by RS
2
Affects Status Importance Assigned to Milestone
Shutter
Fix Released
Medium
Mario Kemper (Romario)

Bug Description

When i'm making a screenshot with Screenshoot menu (Screenshot->Full Screen) and I have compiz, window hides fast but menu stays visible. Sorry for my english. Attachment should clarify everything.

Tags: compiz
Revision history for this message
RS (rafales2) wrote :
Revision history for this message
Vadim Peretokin (vperetokin) wrote : Re: [Bug 316917] Re: Screenshoot menu stay's visible with compiz

This can happen if your Compiz fade is set to be too slow. I'm not sure if
this is a GScrot problem here, or how to deal with it.

Revision history for this message
RS (rafales2) wrote :

I almost fixed it with compiz options. In annimations plugin I added new rule for close animation: No animation for (class=Gscrot) & (type=menu). It works great for window menu, but I still have problem with popup menu in tray icon. GScrot can automatically add that rule with DBus, if compiz is running. I don't know how to fix this problem in tray icon ;-[ I think you should ask about it at compiz fusion forums. Another solution is to check duration of animations with dbus and then just wait before making screenshot.

Revision history for this message
Vadim Peretokin (vperetokin) wrote :

That's a good lead, thank you.

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

Changed in shutter:
assignee: nobody → mario-kemper
importance: Undecided → Medium
milestone: none → 0.70
status: New → In Progress
Revision history for this message
Mario Kemper (Romario) (mario-kemper) wrote :

please reopen this if there are any further issues

Changed in shutter:
status: In Progress → Fix Committed
Changed in shutter:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.