Skip to content

Commit da5ebe7

Browse files
mattnclaude
authored andcommitted
patch 9.2.0501: GTK4: there is no GTK4 UI available
Problem: GTK4: there is no GTK4 UI available Solution: Implement GTK4 UI (Yasuhiro Matsumoto). To enable, use the --enable-gui=gtk4 configure switch. Configure currently favors GTK3 over GTK4 if no explicit --enable-gui switch has been given and both libraries are present closes: #19815 Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Yasuhiro Matsumoto <mattn.jp@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent d004cc4 commit da5ebe7

25 files changed

Lines changed: 5655 additions & 41 deletions

.github/actions/build_vim_on_linux/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ runs:
8888
sudo cp ci/pinned-pkgs /etc/apt/preferences.d/pinned-pkgs
8989
echo '::endgroup::'
9090
91+
# TODO: switch to GTK4 GUI
9192
- name: Install packages
9293
shell: bash
9394
run: |

Filelist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,9 @@ SRC_UNIX = \
498498
src/gui_gtk_f.c \
499499
src/gui_gtk_f.h \
500500
src/gui_gtk_x11.c \
501+
src/gui_gtk4.c \
502+
src/gui_gtk4_f.c \
503+
src/gui_gtk4_f.h \
501504
src/gui_gtk_res.xml \
502505
src/gui_motif.c \
503506
src/gui_xmdlg.c \
@@ -527,6 +530,7 @@ SRC_UNIX = \
527530
src/proto/gui_gtk.pro \
528531
src/proto/gui_gtk_x11.pro \
529532
src/proto/gui_gtk_gresources.pro \
533+
src/proto/gui_gtk4.pro \
530534
src/proto/gui_motif.pro \
531535
src/proto/gui_xmdlg.pro \
532536
src/proto/gui_x11.pro \

src/INSTALL

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ To build Vim on Ubuntu from scratch on a clean system using git:
6565
% sudo apt install libwayland-dev
6666
% make reconfig
6767

68-
Add GUI support:
68+
Add GUI (GTK3) support:
69+
% sudo apt install libgtk-3-dev
70+
% make reconfig
71+
72+
Add GUI (GTK4) support:
6973
% sudo apt install libgtk-3-dev
7074
% make reconfig
7175

src/Makefile

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,23 @@ GTK_MAN_TARGETS = yes
12321232
GTK_TESTTARGET = gui
12331233
GTK_BUNDLE =
12341234

1235+
### GTK4 GUI
1236+
GTK4_SRC = gui.c gui_gtk4.c gui_gtk4_f.c \
1237+
$(GRESOURCE_SRC)
1238+
GTK4_OBJ = objects/gui.o objects/gui_gtk4.o \
1239+
objects/gui_gtk4_f.o \
1240+
$(GRESOURCE_OBJ)
1241+
GTK4_DEFS = -DFEAT_GUI_GTK $(NARROW_PROTO)
1242+
GTK4_IPATH = $(GUI_INC_LOC)
1243+
GTK4_LIBS_DIR = $(GUI_LIB_LOC)
1244+
GTK4_LIBS1 =
1245+
GTK4_LIBS2 = $(GTK_LIBNAME)
1246+
GTK4_INSTALL = install_normal install_gui_extra
1247+
GTK4_TARGETS = installglinks
1248+
GTK4_MAN_TARGETS = yes
1249+
GTK4_TESTTARGET = gui
1250+
GTK4_BUNDLE =
1251+
12351252
### Motif GUI
12361253
MOTIF_SRC = gui.c gui_motif.c gui_x11.c gui_beval.c \
12371254
gui_xmdlg.c gui_xmebw.c
@@ -1289,8 +1306,8 @@ HAIKUGUI_TESTTARGET = gui
12891306
HAIKUGUI_BUNDLE =
12901307

12911308
# All GUI files
1292-
ALL_GUI_SRC = gui.c gui_gtk.c gui_gtk_f.c gui_motif.c gui_xmdlg.c gui_xmebw.c gui_gtk_x11.c gui_x11.c gui_haiku.cc
1293-
ALL_GUI_PRO = proto/gui.pro proto/gui_gtk.pro proto/gui_motif.pro proto/gui_xmdlg.pro proto/gui_gtk_x11.pro proto/gui_x11.pro proto/gui_w32.pro proto/gui_photon.pro
1309+
ALL_GUI_SRC = gui.c gui_gtk.c gui_gtk_f.c gui_gtk4.c gui_gtk4_f.c gui_motif.c gui_xmdlg.c gui_xmebw.c gui_gtk_x11.c gui_x11.c gui_haiku.cc
1310+
ALL_GUI_PRO = proto/gui.pro proto/gui_gtk.pro proto/gui_gtk4.pro proto/gui_motif.pro proto/gui_xmdlg.pro proto/gui_gtk_x11.pro proto/gui_x11.pro proto/gui_w32.pro proto/gui_photon.pro
12941311

12951312
# }}}
12961313

@@ -3364,6 +3381,13 @@ objects/gui_gtk_gresources.o: auto/gui_gtk_gresources.c
33643381
objects/gui_gtk_x11.o: gui_gtk_x11.c
33653382
$(CCC) -o $@ gui_gtk_x11.c
33663383

3384+
objects/gui_gtk4.o: gui_gtk4.c
3385+
$(CCC) -o $@ gui_gtk4.c
3386+
3387+
objects/gui_gtk4_f.o: gui_gtk4_f.c
3388+
$(CCC) -o $@ gui_gtk4_f.c
3389+
3390+
33673391
objects/gui_haiku.o: gui_haiku.cc
33683392
$(CCC) -o $@ gui_haiku.cc
33693393

@@ -4797,6 +4821,7 @@ proto/winclip.pro: winclip.c
47974821
proto/window.pro: window.c
47984822
proto/gui.pro: gui.c
47994823
proto/gui_gtk.pro: gui_gtk.c
4824+
proto/gui_gtk4.pro: gui_gtk4.c
48004825
proto/gui_motif.pro: gui_motif.c
48014826
proto/gui_xmdlg.pro: gui_xmdlg.c
48024827
proto/gui_gtk_x11.pro: gui_gtk_x11.c

0 commit comments

Comments
 (0)