When trying to do a full screenshot, I get the error "Keyboard could not be grabbed".

Asked by Darrel Johnston on 2010-05-05

I'm using PCLOS2010, e17 edition. I CAN take a screenshot if I specify a region, then select the entire screen. Seems to be a keyboard binding issue, or a hot key conflict with another app, maybe?

I can start the app from a terminal with the --debug option, but it's going to create screens of info for me to transmit to you. If I set the save_file_name to snap001, no variables, I still get this behavior.

Here is the tail of the --debug output:

menu_delay_changed was emitted by widget Gtk2::SpinButton=HASH(0x9df7040)

keybinding_sel_toggled was emitted by widget Gtk2::CheckButton=HASH(0x9df72b0)

hide_time_changed was emitted by widget Gtk2::SpinButton=HASH(0x9df6f80)

ns_changed was emitted by widget Gtk2::ComboBox=HASH(0x9df7280)

raw was emitted by widget Gtk2::MenuToolButton=HASH(0x83c0a80)

quit was emitted by widget Gtk2::ImageMenuItem=HASH(0x9c0ada0)
[darrel@localhost ~]$

The "raw was emitted" line is where i clicked the full-screen icon and received the error message. Not much to go on.

Question information

Language:
English Edit question
Status:
Answered
For:
Shutter Edit question
Assignee:
No assignee Edit question
Last query:
2010-05-24
Last reply:
2010-06-01

I've installed PCLOS2010, e17 edition and can confirm this problem. Currently I have no clue why this is not working. I'll investigate further...

Thanks, Mario. If there is any more info I can provide, please let me know. Shutter has a lot of potential.

Mario, I am pretty sure this problem is peculiar to e17, maybe something in the enlightenment foundation libraries. I have since installed the same package, from the same repo, same distro, on an LXDE desktop. Shutter works there, as advertised. The first thing I did on LXDE was to test the full screen capture with Shutter. It produced a nice png.

Thanks for your investigation. I am pretty sure it has something to do
with e17, but I am still curios WHY this is not working.
I am using Ubuntu and I've installed the e17 environment here as well
and everything works as expected. Maybe there are more people having
this problem...

Btw, did you need to install imagemagick, perlmagick and the
libgoocanvas-perl (to enable the editing functionality) yourself? I've
noticed that these packages are not installed automatically under
PCLinuxOS. Maybe the rpm package of Shutter needs some tweaking as well.

I'll let you know if there are any news.

Regards
Mario

dusktrader (dusktrader) said : #5

I have this same error but it occurs for me when trying to take a selection screenshot of something in an rdesktop window. I am currently using the latest Shutter under Ubuntu 10.04, but this problem also occurred with the latest Shutter under Ubuntu Jaunty. The problem began awhile back with an update of Shutter, so I would call it a regression bug. I frequently take screenshots of selections inside RDP (rdesktop) sessions and it suddenly stopped working one day.

Any info about be helpful. Thanks

dusktrader (dusktrader) said : #6

To clarify, I am using the latest Xubuntu 10.04 with the latest Shutter 0.86.2 (sorry about that!)

dusktrader (dusktrader) said : #7

Ok, sorry to post 3 replies on this... but I have some more clues for you. I've just determined that under Xubuntu 10.04, I am able to get the Selection to work under the following circumstance (note: it does NOT work under Xubuntu Jaunty, as I tried everything I could think when this issue first came up...)

When capturing a selection of an rdesktop window... you must have the Xubuntu mouse pointer sitting on the titlebar of the window and then it will work correctly.

If the Xubuntu cursor is sitting inside the rdesktop window, you will get the error.

There is a slight delay from the time you select "Selection" from the Shutter menu -- use this time to move the Xubuntu pointer to the Xubuntu titlebar of the rdesktop window.

Obviously this is unexpected behavior, but perhaps an important clue to why this error is occurring.

Thank you very much for the reply. I am already able to capture a
selection. That's the only option that works. If I try a full screen
shot, I still get "Keyboard could not be grabbed." If I try to do a
Window or Section shot, I get "Maybe mouse pointer could not be grabbed
or the selected area is invalid." I tried changing the mouse from an
e17-driven one to an X-driven one. Made no difference.

Even though this isn't working on e17 for me, I think it is a great app.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

On Mon, May 24, 2010 at 11:03 AM, dusktrader wrote:

> Your question #109678 on Shutter changed:
> https://answers.launchpad.net/shutter/+question/109678
>
> dusktrader proposed the following answer:
> Ok, sorry to post 3 replies on this... but I have some more clues for
> you. I've just determined that under Xubuntu 10.04, I am able to get
> the
> Selection to work under the following circumstance (note: it does NOT
> work under Xubuntu Jaunty, as I tried everything I could think when
> this
> issue first came up...)
>
> When capturing a selection of an rdesktop window... you must have the
> Xubuntu mouse pointer sitting on the titlebar of the window and then
> it
> will work correctly.
>
> If the Xubuntu cursor is sitting inside the rdesktop window, you will
> get the error.
>
> There is a slight delay from the time you select "Selection" from the
> Shutter menu -- use this time to move the Xubuntu pointer to the
> Xubuntu
> titlebar of the rdesktop window.
>
> Obviously this is unexpected behavior, but perhaps an important clue
> to
> why this error is occurring.
>
> --
> If this answers your question, please go to the following page to let
> us
> know that it is solved:
>
> https://answers.launchpad.net/shutter/+question/109678/+confirm?answer_id=6
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/shutter/+question/109678
>
> You received this question notification because you are a direct
> subscriber of the question.

@dusktrader: I can confirm the described behaviour, but this is not really a bug. The Advanced Selection Tool can be controlled via keyboard, so it needs to grab the keyboard focus. This does not work because the rdesktop window already has it and it is not possible to steal it.
You might want to use the Simple Selection Tool - this does not try to grab the keyboard focus.

@Darrel Johnston: I did not find the time to investigate any further yet - but I do have this in mind.

Thanks, Mario. I did a couple of hours of trying different options in the window manager, and with gconf-editor. Wish I had something good to report.

@Darrel: Good and bad news.

The good news are that I've found out why this is not working with e17. Shutter is using libwnck (http://library.gnome.org/devel/libwnck/2.30/intro.html) which is not working correctly with e17. The error message "Keyboard could not be grabbed" is simply wrong here. I did not expect libwnck to fail -> this is a bug.

The bad news are that even if I try to work around the missing functionality some other parts of Shutter are not working correctly as well. This means a lot of work in the end. I'll see what I can do to fix the most important things as soon as possible.

Thanks for your patience.
Mario

Thanks, Mario. I've verified that /usr/lib/libwnck-1.so.22.3.26 is the one used currently in PCLinux.

Ernesto Alfonso (erjoalgo-u) said : #13

I am running into the same issue, but this only happens when not passing the -s flag:

> -s, --select=[X,Y,WIDTH,HEIGHT]
> Capture an area of the screen. Providing X,Y,WIDTH,HEIGHT is optional.

This works, and brings up an interactive prompt to select a bounding box:

> shutter -e -f -o /tmp/test.png -s

This fails:

> shutter -e -f -o /tmp/test.png

Can you help with this problem?

Provide an answer of your own, or ask Darrel Johnston for more information if necessary.

To post a message you must log in.