I need to take a screenshot that records my Eclipse IDE menu item status. For example, if I clicked the "Project" menu and there comes a list of menu items. I need to record those menu items.

The problem is when the menu item list window (which works like a context menu window) has the focus, the screenshot function is not working. I tried everything on this link and nothing works as long as the menu items window is opened. Any mouse click will close the context menu window, so I cannot use mouse either. However if there is no context menu window opened then screenshots works fine.

How can I record the screen with context menu window displayed?

  • what desktop you are using? – Serge Jun 16 '16 at 14:12
  • the default on fedora 23, I think it's gnome – CMZS Jun 16 '16 at 14:14
  • for GNOME see the answer provided; alternatively xfce4-screenshooter being invoked from command line or from Accessories menu offers an option to take a screenshot after a specified delay – Serge Jun 16 '16 at 14:19

If you're using GNOME, or have some GNOME tools installed, you can use gnome-screenshot with the --delay=# option. The delay is in seconds, and gives you that many seconds to open the "Project" menu so that it is open when the screencap actually happens. I also recommend the --window option to keep clutter in the screenshot to a minimum.

Pass the -f filename option to gnome-screenshot to save the resulting image to a file called filename. See man gnome-screenshot.

So to summarize, a command like

gnome-screenshot  --window --delay=10 -f foo.jpg

will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.