Skip to content

Fix removed GDK_DEBUG gl-no-fractional - #7233

Merged
mitchellh merged 2 commits into
ghostty-org:mainfrom
morgan9e:fix-gl-no-fractional
May 6, 2025
Merged

mitchellh merged 2 commits into
ghostty-org:mainfrom
morgan9e:fix-gl-no-fractional

Conversation

@morgan9e

Copy link
Copy Markdown
Contributor

gl-no-fractional is removed from GTK v4.17.5

@morgan9e
morgan9e requested a review from a team as a code owner April 30, 2025 06:56
@pluiedev

pluiedev commented Apr 30, 2025 •

Copy link
Copy Markdown
Member

First of all, why is this necessary? gl-no-fractional has not done anything for quite a while but all it does is adding a log message at startup. Unless GTK 4.17.5+ can't recover from having an invalid debug flag (which isn't true) this shouldn't need to be here.

There are still some users that are using GTK versions that are quite a bit older (Debian 12 ships GTK 4.8, for example) and might still benefit from this.

@morgan9e

morgan9e commented Apr 30, 2025 •

Copy link
Copy Markdown
Contributor Author

First of all, why is this necessary? gl-no-fractional has not done anything for quite a while but all it does is adding a log message at startup. Unless GTK 4.17.5+ can't recover from having an invalid debug flag (which isn't true) this shouldn't need to be here.

There are still some users that are using GTK versions that are quite a bit older (Debian 12 ships GTK 4.8, for example) and might still benefit from this.

I just added upper bound check, nothing had changed. It's still error and it better be fixed I thought.

Also minimum version for that flag is GTK v4.14 (v4.13.6), so I think it's fine.

@pluiedev

Copy link
Copy Markdown
Member

If the only intention here is to suppress the unknown debug flag message then this PR makes a lot more sense - thanks. Still, it was definitely removed at a point a lot earlier than 4.17.5; if we were to really care about this we should have due diligence and set the upper bound to whichever version first removed it.

@morgan9e

Copy link
Copy Markdown
Contributor Author

Thanks. I double checked, its 4.17.5.

https://gitlab.gnome.org/GNOME/gtk/-/blob/main/NEWS#L442

Comment thread src/apprt/gtk/App.zig
gdk_debug.@"gl-no-fractional" = true;
gdk_debug.@"vulkan-disable" = true;

if (gtk_version.runtimeUntil(4, 17, 5)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it didn't exist before, but we should take this opportunity to add a comment about why we set this at all. The history starts here: #4255

I'm not sure how to word the explanation because I myself don't fully grasp the nature of fractional scaling with GTK yet. I just know we don't handle it well at the moment and it causes blurriness. I think the blurriness returned after they removed this and we need to still address this. I'm not sure.

@morgan9e morgan9e Apr 30, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is upstream issue about it. (GNOME/gtk#6514), so.. best solution was to rely on upstream fix but I thought quick dirty fix was better.

NGL has little issue on fractional scaling which can cause blurry fonts, and gl-no-fractional just reverts it and do integer scaling. it makes fonts crisp, but its legacy solution.

@mitchellh mitchellh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment. I won't approve/deny here, I'm fine merging without my comment being addressed, but did want to note it. I think removing the noisy log message is good because it does lead people to feel they should report a bug.

@mitchellh
mitchellh merged commit f73f7c8 into ghostty-org:main May 6, 2025
@github-actions github-actions Bot added this to the 1.2.0 milestone May 6, 2025
@morgan9e
morgan9e deleted the fix-gl-no-fractional branch May 8, 2025 15:14
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