GNOME Bugzilla – Bug 772133
The cursor never gets included in screenshots
Last modified: 2016-09-28 17:44:43 UTC
Created attachment 336458 [details] [review] Fix a typo which prevented to include the cursor in screenshots When using gnome-flashback, taking screenshots never includes the cursor, regardless of the "include_cursor" argument. This happens either from the UI or from the command line: $ dbus-send --type=method_call --dest=org.gnome.Shell.Screenshot /org/gnome/Shell/Screenshot org.gnome.Shell.Screenshot.Screenshot boolean:false boolean:true string:/tmp/screenshot_NO_cursor.png $ dbus-send --type=method_call --dest=org.gnome.Shell.Screenshot /org/gnome/Shell/Screenshot org.gnome.Shell.Screenshot.Screenshot boolean:true boolean:true string:/tmp/screenshot_WITH_cursor.png This happens because of a wrong check about the screenshot type, see the attached patch. Fixing the issue also exposed a segfault. That was happening because wm_window was used but never assigned in the case of capturing the root window. Maybe some gcc options can help to spot errors like that. In the patch I decided to assign wm_windows in an else branch, instead of initializing it at the beginnning of the function, because it looked more explicit and symmetric in this case. Ciao ciao, Antonio
Thanks!