36

Whenever I try to take a screen-shot (in my Ubuntu 12.04 box ) with the global menu, context menu for any window/file, it doesn't work. I don't seem to be able to take snapshots with menu dropped down. How do I get this fixed?

PS. The problem is in both Unity and Gnome3 environments.

Braiam
  • 67,791
  • 32
  • 179
  • 269
rusty
  • 16,327
  • 1
    I have this problem in bionic, and none of the linked answers helps. I use a delay, but neither the command line version or invoking the Screenshot tool in the launcher bar works. Using gimp works, as does hitting PrtSc, though with both of those I have to crop the result. Bizarre that even though I see it take a snapshot with the popup window visible, the screenshot doesn't have it. This happens with the added-on popup menu at http://www.openlinkprofiler.org/r/electionaudits.org?dt=2&dq=electionaudits.org%2Fprinciples – nealmcb Jul 26 '18 at 14:47
  • 1
    2021 here, still not fixed. – Bersan Jan 19 '21 at 11:18

5 Answers5

31

As a workaround you can take a screenshot with a delay for example:

gnome-screenshot --delay=7

or

xfce4-screenshooter -d 5

It seems that this issue of print screen not working in menu context has been around for a while… as can be seen with this bug report

Pablo Bianchi
  • 15,657
jmunsch
  • 2,213
  • 1
  • 22
  • 29
16

Lazy answer

(for independent fast learners)

There's controversy regarding this situation.

Fast answer / workaround

(for advanced ubuntu users)

  • Add a custom shortcut to the following command:
    gnome-screenshot --delay=numIntValueInSecs
    for example
    gnome-screenshot --delay=3
  • Add another one to take active window screenshots:
    gnome-screenshot -w --delay=3

    That's it, but I'd also recommend setting 2 others that would give you more time to navigate deeper in menus.

    • gnome-screenshot --delay=10
    • gnome-screenshot -w --delay=10

    enter image description here

Elaborate answer

(novice to hacker)

Intro:

Whenever you press PrntScr, all Ubuntu does is calling gnome-screenshot which is usually located on the /usr/bin/ path and available from the "terminal" (teletype, tty, cli, command line/prompt), so you can use it in all sorts of ways to fit your funky purposes.

The gnome-screenshot little program accepts optional parameters, you can see all options by passing the standard parameter to ask for help, you know the one (-h)

enter image description here

If you're still not sure how to use this, you can always read a more detailed help, just ask for the manual typing man gnome-screenshot

enter image description here

The more you read full manuals, hacking ubuntu to fit your needs will become intuitive and you won't need other people to give you step by step instructions. Maybe by this point you even know how to make this workaround by yourself, if you're still lost (hopefully not), just keep reading...

Instructions:

  • Step Zero: Open Ubuntu's system settings and navigate to the Keyboard option:

enter image description here

Now

  1. Navigate to Shortcuts tab.
  2. Select Custom Shortcuts
  3. Hit the + button to add your new custom shortcut.
  4. Give a name and a command.
    (just like described on the "Fast Answer" above)
    4½. Assign the key combination you'd like.
  5. Close this window or it wont work.

enter image description here

*presto!
You just took one further step to be an ubuntu master, I hope this answer was helpful *

JorgeArtware
  • 3,527
  • 1
  • 21
  • 23
3

This is not a "problem". You'll get the exact same kind of issue with another operating system like Windows.

To take snapshots with menu dropped down you have to use a specialized tool such as Shutter. You'll find this free and open-source tool in Ubuntu Software Center. There is a special option in Shutter to make screenshots of menus/sub-menus which performs a delayed capture of the screen.

Of course, you can use it with Unity and Gnome 3.

Golboth
  • 1,404
  • 1
    what strange logic "Windows has the same so it's no issue". – sehe Nov 12 '17 at 14:57
  • 1
    @sehe This is not exactly what I've written... Maybe I should have said that it was the way most UI were designed (without going into details) instead of giving an example... Unity and Gnome 3 are two different Window Managers which have a similar behaviour ("issue") with dropped down menus and screenshots even if they have nothing in common with Windows UI... – Golboth Nov 12 '17 at 15:53
  • 1
    I guess my surprise was more with "This is not a "problem"" :) I think most people intuitively grasp that anything related to (mouse)focus can be hard to observe without interfering. Understanding the problem doesn't remove it – sehe Nov 12 '17 at 18:06
  • 1
    In fairness, I just used Shutter because the delayed-screenshot approach with gnome3 doesn't actually work (at least not in the application I tried to capture). +1 – sehe Nov 12 '17 at 18:07
  • 1
    The comment about windows is false. Perhaps it used to be true (don't think so), but today I regularly take screenshots on windows with menus/popups open. – Ofek Shilon Jun 18 '20 at 15:40
  • By just using "Alt + Print Screen" key, it was not possible to take screenshots of a window with old Windows native drop-down menus (menus/sub-menus) open in the past and it should still be the case. By using "Print Screen" with Windows 10 (1909+, maybe older), it is possible, but not very practical if you have several monitors... Please note that with newer UIs, you don't have such issues at all on any OS (taking a screenshot by using Alt + Print Screen of a Firefox window with the new menu shown works). For more features, you can use Flameshot or Shutter under Ubuntu, Greenshot on Windows. – Golboth Jun 19 '20 at 06:29
1

I use Flameshot program for it

  1. Install Flameshot
  2. Open launcher from Flameshot menu screen1
  3. Choose delay and press Take new screenshot screen2
Alex
  • 11
  • 2
1

The answers with gnome-screenshot --delay ... don't seem to work (anymore?) to capture an open menu. At least not in Ubuntu 20.04 with a FileZilla window/menu. It does capture the window after the delay, but not the open menu.

shutter doesn't seem to be in the repos for 20.04.

But scrot works. ( apt install scrot )

scrot -ud 8

Will take a screenshot of the active window in 8 seconds, and save it to the current directory.

-d, --delay NUM
       Wait NUM seconds before taking a shot.

-u, --focused Use the currently focused window.

man scrot for more options.

mivk
  • 5,312