[vim/vim] Support fullscreen (guioptions+=s) for GTK (PR #20303)

8 views
Skip to first unread message

MURAOKA Taro

unread,
May 23, 2026, 7:16:22 AM (2 days ago) May 23
to vim/vim, Subscribed
  • Add codes for GTK
  • Update documents
    • The explanation about fullscreen mode has been moved to gui.txt.
    • Added information to the description of the -s flag in guioptions, stating that it can also be used with GTK.
    • Regenerate runtime/doc/tags

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

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

Commit Summary

  • 4a0b4fe Support fullscreen (guioptions+=s) for GTK

File Changes

(8 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20303@github.com>

Christian Brabandt

unread,
May 23, 2026, 11:36:50 AM (2 days ago) May 23
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#20303)

Thanks, but it causes build failures:

  gui_gtk_x11.c:2854:35: error: unused parameter 'widget' [-Werror,-Wunused-parameter]
   2854 | mainwin_state_event_cb(GtkWidget *widget,
        |                                   ^
  gui_gtk_x11.c:2856:19: error: unused parameter 'user_data' [-Werror,-Wunused-parameter]
   2856 |                        gpointer user_data)
        |                                 ^
  2 errors generated.
  make[1]: *** [Makefile:3384: objects/gui_gtk_x11.o] Error 1
  make[1]: *** Waiting for unfinished jobs....
  make[1]: Leaving directory '/home/runner/work/vim/vim/src'
  make: *** [Makefile:29: first] Error 2


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

MURAOKA Taro

unread,
May 23, 2026, 9:17:22 PM (2 days ago) May 23
to vim/vim, Push

@koron pushed 1 commit.

  • 7cea74b Support fullscreen (guioptions+=s) for GTK


View it on GitHub or unsubscribe.


Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20303/before/4a0b4fe43066c2e5d1a271871a5569abbc66a3d8/after/7cea74b98419ae8e80609803036bb8b47e1edca3@github.com>

MURAOKA Taro

unread,
May 23, 2026, 9:23:32 PM (2 days ago) May 23
to vim/vim, Push

@koron pushed 1 commit.

  • b406c48 Support fullscreen (guioptions+=s) for GTK


View it on GitHub or unsubscribe.


Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20303/before/7cea74b98419ae8e80609803036bb8b47e1edca3/after/b406c480927fbdbeb792cb526d09fdb2b2d42a0d@github.com>

MURAOKA Taro

unread,
May 23, 2026, 9:38:13 PM (2 days ago) May 23
to vim/vim, Subscribed
koron left a comment (vim/vim#20303)

Sorry, I missed the CI results.

I've made the fix (added UNUSED). Please review this again.

To be honest, I didn't know how to enable the UNUSED check during normal builds. I should have applied ci/config.mk.sed and modified src/auto/config.mk.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

mattn

unread,
May 24, 2026, 8:04:13 AM (18 hours ago) May 24
to vim/vim, Subscribed
mattn left a comment (vim/vim#20303)

Tested on GTK4 with the diff below — works.

diff --git a/src/gui_gtk4.c b/src/gui_gtk4.c
index 34e9617a32..cf5e5ab876 100644
--- a/src/gui_gtk4.c
+++ b/src/gui_gtk4.c
@@ -280,6 +280,7 @@ static gboolean drop_cb(GtkDropTarget *target, const GValue *value, double x, do
 #endif
 static void mainwin_destroy_cb(GObject *object, gpointer data);
 static gboolean delete_event_cb(GtkWindow *window, gpointer data);
+static void mainwin_fullscreened_cb(GObject *obj, GParamSpec *pspec, gpointer user_data);
 static void drawarea_realize_cb(GtkWidget *widget, gpointer data);
 static void drawarea_unrealize_cb(GtkWidget *widget, gpointer data);
 static void drawarea_resize_cb(GtkDrawingArea *area, int width, int height, gpointer data);
@@ -448,6 +449,8 @@ gui_mch_init(void)
 
     g_signal_connect(G_OBJECT(gui.mainwin), "close-request",
 		     G_CALLBACK(delete_event_cb), NULL);
+    g_signal_connect(G_OBJECT(gui.mainwin), "notify::fullscreened",
+		     G_CALLBACK(mainwin_fullscreened_cb), NULL);
 
     // A vertical box holds the menubar, toolbar and main text window.
     vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
@@ -733,6 +736,26 @@ gui_mch_unmaximize(void)
 	gtk_window_unmaximize(GTK_WINDOW(gui.mainwin));
 }
 
+    void
+gui_mch_set_fullscreen(int flag)
+{
+    if (gui.mainwin == NULL)
+	return;
+    if (flag)
+	gtk_window_fullscreen(GTK_WINDOW(gui.mainwin));
+    else
+	gtk_window_unfullscreen(GTK_WINDOW(gui.mainwin));
+}
+
+    static void
+mainwin_fullscreened_cb(GObject *obj,
+	GParamSpec *pspec UNUSED, gpointer user_data UNUSED)
+{
+    // Force a redraw of the drawing area when entering fullscreen mode.
+    if (gtk_window_is_fullscreen(GTK_WINDOW(obj)))
+	gui_focus_change(TRUE);
+}
+
 /*
  * Called when the font changed while the window is maximized or GO_KEEPWINSIZE
  * is set.  Recalculate Rows and Columns based on the current window size.
diff --git a/src/proto/gui_gtk4.pro b/src/proto/gui_gtk4.pro
index d8ebd6c634..1308574c9b 100644
--- a/src/proto/gui_gtk4.pro
+++ b/src/proto/gui_gtk4.pro
@@ -16,6 +16,7 @@ int gui_mch_get_winpos(int *x, int *y);
 void gui_mch_set_winpos(int x, int y);
 int gui_mch_maximized(void);
 void gui_mch_unmaximize(void);
+void gui_mch_set_fullscreen(int flag);
 void gui_mch_newfont(void);
 void gui_mch_settitle(char_u *title, char_u *icon);
 void gui_mch_set_shellsize(int width, int height, int min_width, int min_height, int base_width, int base_height, int direction);


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

MURAOKA Taro

unread,
May 24, 2026, 9:41:01 PM (4 hours ago) May 24
to vim/vim, Push

@koron pushed 2 commits.

  • 929005c Support fullscreen (guioptions+=s) for GTK
  • 4fa071c GTK4 also supports fullscreen mode


View it on GitHub or unsubscribe.


Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20303/before/b406c480927fbdbeb792cb526d09fdb2b2d42a0d/after/4fa071c9fb7c1c02bfdbbd26582eb8be96461ac3@github.com>

MURAOKA Taro

unread,
May 24, 2026, 9:43:53 PM (4 hours ago) May 24
to vim/vim, Subscribed
koron left a comment (vim/vim#20303)

@mattn Thank you. I've added that patch to this pull request.

And I've rebased it with the current HEAD. Please review it again.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

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

Reply all
Reply to author
Forward
0 new messages