[vim/vim] GTK4: Add option to use hardware accelerated rendering backend (PR #20437)

8 views
Skip to first unread message

Foxe Chen

unread,
Jun 7, 2026, 12:08:45 AM (2 days ago) Jun 7
to vim/vim, Subscribed

Add configure option --enable-gtk4-hwaccel to use GtkSnapshot for rendering in the GTK4 GUI.

Compared to #20324, the implementation is cleaner and more readable. I tried experimenting with other possible ways to make things simpler, but I did not get very far.

The performance boost on my machine is noticeable (both compiled using same optimized flags with laptop running on battery):

Current rendering path:

https://github.com/user-attachments/assets/d8cab615-ed3e-4226-a07b-5c6dac24a9a4

The excessive lag at the start is probably due to the CPU being too slow to react? However that may as well also be another issue.

Hardawre accelerated rendering path:

https://github.com/user-attachments/assets/4947881b-fff1-4382-87a3-8d1c58793ae2


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20437

Commit Summary

File Changes

(12 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20437@github.com>

arkissa

unread,
Jun 7, 2026, 2:08:23 PM (2 days ago) Jun 7
to vim/vim, Subscribed
Arkissa left a comment (vim/vim#20437)

IMO, For users who build Vim themselves, GTK4 hwaccel should probably be auto rather than manual opt-in. GTK4/GSK can choose the appropriate renderer based on the runtime environment, and better accelerated rendering is one of the main reasons to choose GTK4 over GTK3.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20437/c4643497060@github.com>

Foxe Chen

unread,
Jun 7, 2026, 2:11:13 PM (2 days ago) Jun 7
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#20437)

IMO, For users who build Vim themselves, GTK4 hwaccel should probably be auto rather than manual opt-in. GTK4/GSK can choose the appropriate renderer based on the runtime environment, and better accelerated rendering is one of the main reasons to choose GTK4 over GTK3.

I think we should initially keep it optional for now for a bit so users can test and report any bugs/crashes. Then when its stable enough we can fully switch over.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20437/c4643512346@github.com>

Reply all
Reply to author
Forward
0 new messages