-
-
Notifications
You must be signed in to change notification settings - Fork 42
Fix GLib-CRITIAL on Glib::Source->remove for One-Time Timeout Source #769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DarthGandalf
merged 2 commits into
shutter-project:master
from
Tao-T:fix-glib-source-remove-critial
Oct 22, 2025
Merged
Fix GLib-CRITIAL on Glib::Source->remove for One-Time Timeout Source #769
DarthGandalf
merged 2 commits into
shutter-project:master
from
Tao-T:fix-glib-source-remove-critial
Oct 22, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
One-Time Timeout Source would be auto removed when callback ended. Then the Source ID is freed to a pool for reuse and can be assigned to other new source. Hitting a freed ID means the program on risk of wrongly hitting a reused ID, which is unexpected. This commit fixes the usage of one-time Timeout sources by resetting ID records in callbacks and checking them before Source->remove calls. Also, some unused Source->remove code cleaned up in this commit. Fix shutter-project#768
Member
|
Thanks for all these PRs! You didn't really need to open issues separately - a PR which fixes the issue would be enough |
share/shutter/resources/modules/Shutter/App/ShutterNotification.pm
Outdated
Show resolved
Hide resolved
pitcany
added a commit
to pitcany/shutter
that referenced
this pull request
Nov 24, 2025
* Add a very crude wayland support
Using XDG portal API
Ref #187
* Use the upstream Gtk3::ImageView Selector again, bumping its requirement to v10
* version 0.99.1
* Fix something which was supposed to be there only for debug
The wayland-specific code was accidentally executed even on X11
Fix #416
Ref #187
* version 0.99.2
* * removed redundant code
* * fixed warning "Redundant argument in sprintf at share/shutter/resources/modules/Shutter/Draw/DrawingTool.pm line 1326."
* * start writing tests
* * reverted back part of previously removed code
* * use the method "set_status" for AppIndicator::Indicator
* * working on new implementation of Shutter::App::Common
* * porting new Common into shutter
* * fixed attributes that used in void context
* * added .gitignore
* * renamed 02_update_warning_text.t -> 01_update_warning_text.t
* * moving a setting up of "_icontheme" to a separate method
* * added getters/setters for a new "common" class
* * writing tests for Shutter::App::Common
* * working on tests
* * use a new Shutter::App::Common class
- moved old realization to Shutter::App::OldCommon
- renamed Shutter::App::NewCommon to Shutter::App::Common
- updated tests and bin/shutter
* * use the method "get_root" instead of direct call to internal attribute of Shutter::App::Common class
* * added header msg for updated Shutter::App::Common
* * get rid of old code and fixed some comments
* * fixed warnings "Too late to run INIT block" in tests
* * a new version of Shutter::App::Directories
* * get rid of fct_init_environment in favour Shutter::App::Directories::create_hidden_home_dir_if_not_exist
* * work on tests for Shutter::App::Directories
* * finished tests for Shutter::App::Directories
* * added a class Shutter::Draw::UIManager for configuring UI of drawing tool
* * removed using prototype
* * writing tests for Shutter::Draw::UIManager
* * added Shutter::Draw::Utils
* * starting to move a working logic from Shutter::Draw::DrawingTool to separate classes
* * added auxiliary module Test::Window for tests
* * added tests for methods _setup_icontheme and get_current_monitor of Shutter::App::Common
* * stopped using Test::MockModule in tests of Shutter::App::Common
* * added module Test::Common
* * few improvements in tests of Shutter::App::Common
* * working on tests of new getters and setters of Shutter::Draw::DrawingTool
* * added Shutter::Draw::Ellipse
* * using const for font and set uid as only a getter
* * added more tests for getters and setters of DrawingTool
* * get red of redundant imports
* * changed attributes x -> X, y -> Y in Shutter::Draw::Ellipse
* * start writing tests for Shutter::Draw::Ellipse
* * added getter for uimanager
* * more tests for Shutter::Draw::UIManager
* * tests for UIManager::setup
* * small fix in comment
* * added Test::SimpleApp
* * renamed tests or Draw
* * improvements in tests of UIManager
* Update bug_report.md
Since there is rudimentary Wayland support now, the display server in use might be an important piece of information.
* * more tests for Shutter::Draw::Ellipse
* * direct call Shutter::Draw::Utils::points_to_canvas_points
* * added copyright headers for Shutter::Draw::Ellipse and Shutter::Draw::UIManager
* * reverted using Shutter::Draw::Ellipse in Shutter::Draw::DrawingTool
* * do not using Exporter in Shutter::Draw::Utils
* * writing tests for Shutter::Draw::Utils
* * added more tests for Shutter::Draw::UIManager
* * added header for Shutter::Draw::Utils
* * fixed wrong creation of GooCanvas2::CanvasPoints object in Shutter::Draw::Utils
* * fixed warning 'Argument "line" isn't numeric in numeric eq (==) at ...Draw/DrawingTool.pm line 2322.'
* * more tests for Shutter::Draw::Utils::points_to_canvas_points
* * added cpanfile
* * removed using strictures
* * appended cpanfile
* Create run-tests.yml
* Install dependencies
* Install apt dependencies
* Add missing cairo dep
* Add missing libpango1.0-dev dep
* Fix for #440
* Update some strings in the French translation
Thanks to @DanieLoche
* Use the fix for zero font size proposed in #301
Thanks to @wkevin! It sets the font to default value, which is better than zero at least.
* Regenerate man page
Used command:
$ pod2man bin/shutter share/man/man1/shutter.1
Ref #456
* Updated deps in CI control file
* Added missing space
* Install the missing perl libs using cpanm
* Remove missing dependencies from the apt call
* Remove the correct dependencies from the apt call now
* Add libgoocanvas-2.0-dev as makedepend for GooCanvas2::CairoTypes
* Fixed the cpanm calls
* Trying to enable GUI related tests
Using xvfb as described in https://stackoverflow.com/questions/68292797/running-java-gui-tests-on-github-using-xvfb
* Set environment variable outside of run call
* Try to fix the pwd call
* Try to get the correct working directory
* Install cpanm via package management
* Try to fix 404 errors on package installation
* Fix appstream validation errors
Before:
```
root@590df40fac1a:~# appstreamcli validate shutter.appdata.xml
I: org.shutterproject.shutter:8: unknown-tag license
E: org.shutterproject.shutter:27: screenshot-no-media
E: org.shutterproject.shutter:30: screenshot-no-media
I: org.shutterproject.shutter:~: content-rating-missing
E: org.shutterproject.shutter:28: screenshot-no-media
E: org.shutterproject.shutter:29: screenshot-no-media
? Validation failed: errors: 4, infos: 2, pedantic: 5
```
After:
```
root@590df40fac1a:~# appstreamcli validate shutter.appdata.xml
I: org.shutterproject.shutter:~: content-rating-missing
? Validation was successful: infos: 1, pedantic: 5
```
* Fix for #453
We were hit by https://stackoverflow.com/questions/61765706/perl-sort-corrupts-bsd-glob-results
* Make profile names visible in "Edit->Quick profile select"
* Fix removing profiles in drop down box in settings
* Proper fix for correctly showing profile labels
* Fix #487
* Allow all special characters in file names except for slash and backslash
* Move filename valitation into fct_validate_filename
* Fixed copy&paste mistake
* Remove dysfunctional upload plugins, see #528
* Removed a stray Dropbox webservice module as well
* This is not bazaar anymore
* Add a visible warning about wayland
See #187
* Update version number
* Fix not appearing tray icon on system startup
* Fix crash
Close #561
* Rename appdata to metainfo
* Update version
* Make variables in fct_validate_filename local to fix #593
Looks like calling fct_validate_filename() to check the profile name interfered with setting the filename variable from the settings dialog such that the latter has been set to an empty string for some reason. With all variables made local there shouldn't be any interference left.
* Output version in log
* Partially address #602
* Fix make uninstall
It was broken since 724e63b
Close #603
* Quick and dirty fix for #570
Move the error handling to an earlier point, which prevents the erroneous state after a zero width or height area screenshot. Actually, the error handling should be taken care of by the Shutter::Screenshot::Error module but it seems to fails for this particular error.
* Remove unnecessary variable to improve readability
* Another little readability improvement.
* Fix #604: setting saving location on profile loading was broken
* Fix #597: The edit button is disabled
For some reason due to Glib::IO::AppInfo::get_recommended_for_type failing to determine recommended apps for the "Open with" menu switching the edit button to sensitive fails. Checking $apps for being undefinied leaves the user without apps in the "Open with" menu but keeps the edit button enabled.
* Disable "open with" menu if determining apps fails; catch undefined $apps on another occasion
* Add option for firing screenshot without pressing the enter key
* Adding the GUI option for making the confirmation optional
* Fix copy&paste mistake in comment
* Restore settings line that got lost in previous commit
* Fix selection not becoming static on release mouse button
I thought that if (not ...) is the same as unless(...) but looks like there is some subtle difference...
* Check if we are on X11 before using Wnck
* Fix setting the screenshot name on X11 broken by previous commit
* Make workspace dropdown button sensitive in X11 only
* Remove debug output
* Set x11_supported to true unless XDG_SESSION_TYPE tells otherwise
* Fix #613: Prevent user from seting a filename without suiting wildcards
* Removed unnececary debug code
* Replace sanity check variable with an early return
* Added webp as additional image format
* Enabled quality setting for webp
* Removed debug output
* Fixed setting initial value for $int_webp to -1
* Fixed keyword for the quality setting
* Fixed mistake in quality keyword
* Fix #162: Removes panic in Autostart package
Panic in Auotstart::create_autostart_file hang up the application. Log
example:
```
*** unhandled exception in callback:
*** Not a directory at /usr/share/perl5/Shutter/App/Autostart.pm line 59.
*** Shutter::App::Autostart::create_autostart_file(Shutter::App::Autostart=HASH(0x555ef7853e08), "/home/user/.config/autostart", "", "", "") called at /usr/bin/shutter line 3189
*** Shutter::App::__ANON__() called at /usr/lib/x86_64-linux-gnu/perl5/5.38/Glib/Object/Introspection.pm line 67
*** eval {...} called at /usr/lib/x86_64-linux-gnu/perl5/5.38/Glib/Object/Introspection.pm line 67
*** Glib::Object::Introspection::__ANON__(Shutter::App=HASH(0x555ef76dcf20)) called at /usr/bin/shutter line 10943
*** ignoring at /usr/lib/x86_64-linux-gnu/perl5/5.38/Glib/Object/Introspection.pm line 67.
```
* Add debug output
* Images that are pasted from clipboard now get resized to fit the window
* Save clipboard import images in the same way as newly created images
* Improve file name for images that have been imported from clipboard
* Replaced UUID with a big random number
* Allow zero values for selection origin coordinates
* Update version to 0.99.5 for new release
* Try to get rid of the crash
* FIX: typo when setting png quality
* Added AVIF support
* Refactor file format recognition code
* Refactor GlobalSettings.pm
* Simplify setting image quality value a bit
* Fix typo in Save.pm
* Refactor parts of Save.pm
* Refactor further parts of Save.pm
* Further simplify Save.pm
* Fix array definition to get rid of warnings
* Fixed crash due to wrong access to a hash
* Simplify file format code a bit
* Replace depricated action
* Fix typo
* Added error output
* Applied changes by nicomen to prevent will not stay shared messages
* CI: Bump checkout version to avoid warnings about nodejs being deprecated (#710)
run-tests
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/checkout@v2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
* Test: Set explicit message locale to C to be able to match error messages when not running in english environments (#711)
* Test: Add syntax tests and add missing use warnings (#712)
* Test: Add syntax tests and add missing use warnings
* Test: Add missing test dependency
* Test: Drop fancy tilde in test file name. Order is not so important
* Simplify syntax test
* Remove unused modules
* Avoid shared variable warning in DrawingTool by using an explicit anonymous function (#713)
* Declare variables at the beginning
* Add paypal option to funding
Since github removed built-in support for paypal a while ago
* Re #218 Don't leak pixelated data (#729)
Before this change, pixelization would often "leak" unpixelized data
"under" pixelized data. This change removes the ability to do alpha
blending from the pixelized rectangle.
* Fix type in man (#733)
* Fix type in man
* Regenerate man page
$ pod2man bin/shutter share/man/man1/shutter.1
Close #732
---------
Co-authored-by: Alexey Sokolov <alexey@asokolov.org>
* Update CHANGES up to 0.99.5 (#734)
* Update shutter
* Update CHANGES for 0.99.6 (#736)
* Set default value for debug to FALSE to make Shutter less verbose
* Change URL in "Help > Get help online..." to the website's FAQ page
* Fix Perl closure usage in callback of SelectorAdvanced.
The anonymous closure and named closure are different in Perl. Here anonymous
is expected, similar to #713
Fix shutter-project/shutter#766
* Fix GLib-CRITIAL on Glib::Source->remove for One-Time Timeout Source
One-Time Timeout Source would be auto removed when callback ended. Then the
Source ID is freed to a pool for reuse and can be assigned to other new source.
Hitting a freed ID means the program on risk of wrongly hitting a reused ID,
which is unexpected.
This commit fixes the usage of one-time Timeout sources by resetting ID records
in callbacks and checking them before Source->remove calls.
Also, some unused Source->remove code cleaned up in this commit.
Fix shutter-project/shutter#768
* Fix GLib-CRITICAL on g_variant_type check (Glib::IO::SimpleAction)
According to Glib::Object::Instrospection, NULL in C is represented by `undef`
in perl for those actions w/o callback args.
Fix shutter-project/shutter#770
* Fix missing GDK_SELECTION_CLIPBOARD
Gtk3::Gdk::SELECTION_XXXX is neither a constant nor a package variant. So
`undef` is passed in Gtk3::Clipboard::get() with warnings.
This commit has Gtk3::Gdk::Atom::intern involved to help fetching
any valid selection types such as GDK_SELECTION_CLIPBOARD, GDK_SELECTION_PRIMARY
and so on.
Fix shutter-project/shutter#772
* use Pango loaded by Gtk3 to avoid GLib-GObject-CRITICAL and align Pango API
'use Gtk3' would also set up namespace Pango, based on loader
Glib::Object::Introspection. This loader conflicts w/ the common one applied by
'use Pango' (i.e. DynaLoader). So we get lots of CRITIICAL messages in former
versions.
This commit has explicit 'use Pango' removed and mismatched interface tuned.
Also pango-version related logics are cleaned up as Gtk3 has already required
pango >= 1.20 since 3.0.0
Fix shutter-project/shutter#776
* suppress errors for no g_application_activate and failed drag icon of ImageView
Boring messages reduced:
gtk_drag_source_set_icon_pixbuf on ImageView object keeps failed. Just
comment out it.
gapplication always expects handler of 'activate' signal. A dummy implementation
provided.
Fix shutter-project/shutter#778
* remove odd 'defined' check in shutter-project/shutter#769
* Fix drag icon
Close #779
Close #778
* fix duplicated tray icons after slow reloading of some X window manager (#765)
A workaround to fix shutter-project/shutter#764 . The embedded status can keep false for a while during reloading of some X window manager (system tray included). The every-10-sec icon status checking may hit this time slice and create duplicated tray icons.
* Add enhanced Wayland support for Ubuntu 22.04
This commit modernizes Shutter's screenshot capture to work reliably on
Ubuntu 22.04 with GNOME 42, supporting both Wayland and X11 sessions.
Key changes:
1. New Backend.pm module for session detection and capability checking
- Automatically detects Wayland vs X11 session
- Reports available capture methods (XDG Portal, gnome-screenshot, grim)
- Enables dynamic button states based on actual capabilities
2. Enhanced Wayland.pm with multiple capture backends
- XDG Desktop Portal with interactive selection support
- gnome-screenshot fallback for selection, window, and full screen
- grim/slurp support for wlroots-based compositors (Sway)
- Proper error handling and timeout management
3. Updated main shutter script
- Uses Backend module for session detection
- Capability-based UI button enabling/disabling
- Selection and window capture now work on Wayland when tools available
- Improved warning messages explaining available features
4. Documentation
- New docs/UBUNTU_22.04_WAYLAND.md with detailed setup instructions
- Updated README.md with feature availability matrix
- Installation instructions for Ubuntu 22.04
5. Tests
- New t/backend_test.pl for verifying backend detection
Feature availability on Wayland:
- Full screen: Yes (via XDG Portal or gnome-screenshot)
- Selection: Yes (via gnome-screenshot, grim+slurp, or portal)
- Window: Yes with gnome-screenshot installed
- Menu/Tooltip: No (Wayland security model limitation)
* shutter for 22.04
* Fix: Use github.workspace for TEST_APP_SHUTTER_PATH
Co-authored-by: pitcany <pitcany@gmail.com>
---------
Co-authored-by: Alexey Sokolov <sokolov@google.com>
Co-authored-by: Alexander Ruzhnikov <ruzhnikov85@gmail.com>
Co-authored-by: Michael Kogan <photon89@googlemail.com>
Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>
Co-authored-by: faveoled <85760289+faveoled@users.noreply.github.com>
Co-authored-by: Yury Akudovich <yorik13@gmail.com>
Co-authored-by: caribo <paul@caribo.co.uk>
Co-authored-by: Nicolas Mendoza <mendoza@pvv.ntnu.no>
Co-authored-by: Alexey Sokolov <alexey@asokolov.org>
Co-authored-by: limitedAtonement <limitedAtonement@users.noreply.github.com>
Co-authored-by: TAO TANG <tang.tao.cn@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
One-Time Timeout Source would be auto removed when callback ended. Then the Source ID is freed to a pool for reuse and can be assigned to other new source. Hitting a freed ID means the program on risk of wrongly hitting a reused ID, which is unexpected.
This commit fixes the usage of one-time Timeout sources by resetting ID records in callbacks and checking them before Source->remove calls. Also, some unused Source->remove code cleaned up in this commit.
Fix #768