Skip to content

Remove old window presentation workaround that causes timstamp overflows#778

Merged
aquaherd merged 1 commit into
projecthamster:masterfrom
chrysn-pull-requests:uptime49days
Mar 4, 2026
Merged

Remove old window presentation workaround that causes timstamp overflows#778
aquaherd merged 1 commit into
projecthamster:masterfrom
chrysn-pull-requests:uptime49days

Conversation

@chrysn

@chrysn chrysn commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

On systems with an uptime of > 49 days (32bit overflow of millisecond counters), I get warnings like this:

Traceback (most recent call last):
  File "/home/chrysn/git/hamster/./src/hamster-cli.py", line 149, in on_activate_window
    self._open_window(action.get_name(), data)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chrysn/git/hamster/./src/hamster-cli.py", line 209, in _open_window
    controller.present()
    ~~~~~~~~~~~~~~~~~~^^
  File "/home/chrysn/git/hamster/src/hamster/lib/configuration.py", line 80, in present
    self.window.present_with_time(glib.get_monotonic_time() / 1000)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OverflowError: 5068768155 not in range 0 to 4294967295

While they have no observable impact, somewhere down there things do go wrong.

Tracing through the code, this was a workaround for GTK 3.24.1 -- I'd claim that this was so long ago that nobody is using it any more, but the oldest version I could easily date through Debian was 3.24.24 (bullseye, 2021) and 3.24.32 (Ubuntu Jammy, 2022 LTS), and old changelog entries were purged from Debian packages in 2019 when it was at 3.24.10, so yeah it's really ancient.

(Before I looked up the version, I tried for workarounds self.window.present_with_time(gdk.CURRENT_TIME) and self.window.present_with_time((glib.get_monotonic_time() // 1000) & 0xffffffff), which also worked, but really, I don't think we'll find anyone who can reproduce what this was a workaround for without serious archeology).

@aquaherd aquaherd merged commit f61a45e into projecthamster:master Mar 4, 2026
0 of 4 checks passed
@chrysn chrysn deleted the uptime49days branch May 17, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants