diff --git a/.github/workflows/build-and-test-v3.yml b/.github/workflows/build-and-test-v3.yml index cc2c6ded0..0392e5abf 100644 --- a/.github/workflows/build-and-test-v3.yml +++ b/.github/workflows/build-and-test-v3.yml @@ -118,8 +118,8 @@ jobs: packages: libgtk-3-dev libwebkit2gtk-4.1-dev libwayland-dev build-essential pkg-config xvfb x11-xserver-utils at-spi2-core xdg-desktop-portal-gtk version: 1.0 - - name: Install linux dependencies (GTK4) - webkit-gtk6-support branch only - if: matrix.os == 'ubuntu-latest' && github.head_ref == 'feature/webkit-gtk6-support' + - name: Install linux dependencies (GTK4) + if: matrix.os == 'ubuntu-latest' run: | sudo apt-get update sudo apt-get install -y libgtk-4-dev libwebkitgtk-6.0-dev @@ -150,8 +150,8 @@ jobs: task test:examples echo "Example compilation tests (GTK3) completed successfully" - - name: Build Examples (GTK4 experimental) - if: matrix.os == 'ubuntu-latest' && github.head_ref == 'feature/webkit-gtk6-support' + - name: Build Examples (GTK4) + if: matrix.os == 'ubuntu-latest' working-directory: v3 run: | echo "Starting example compilation tests (GTK4)..." @@ -180,11 +180,10 @@ jobs: go test -v ./... ' - - name: Run tests (ubuntu) - GTK4 experimental - if: matrix.os == 'ubuntu-latest' && github.head_ref == 'feature/webkit-gtk6-support' + - name: Run tests (ubuntu) - GTK4 + if: matrix.os == 'ubuntu-latest' working-directory: v3 - # Skip all service tests that hang in CI due to GTK4 display requirements - # The services tests require a fully functional GTK4 display which xvfb cannot provide + # Skip service tests that hang in CI due to GTK4 display requirements run: > xvfb-run --auto-servernum sh -c ' @@ -243,8 +242,8 @@ jobs: packages: libgtk-3-dev libwebkit2gtk-4.1-dev libwayland-dev build-essential pkg-config version: 1.0 - - name: Install linux dependencies (GTK4) - webkit-gtk6-support branch only - if: matrix.os == 'ubuntu-latest' && github.head_ref == 'feature/webkit-gtk6-support' + - name: Install linux dependencies (GTK4) + if: matrix.os == 'ubuntu-latest' run: | sudo apt-get update sudo apt-get install -y libgtk-4-dev libwebkitgtk-6.0-dev @@ -292,8 +291,7 @@ jobs: cd .. wails3 build - # Note: GTK4 template builds are not tested here as wails build doesn't - # support -tags flag yet. GTK4 compilation is verified by Go tests. + # GTK4 template builds are covered by the Go example compilation tests above. build_results: if: ${{ always() }} diff --git a/v3/Taskfile.yaml b/v3/Taskfile.yaml index 171853e14..81603c409 100644 --- a/v3/Taskfile.yaml +++ b/v3/Taskfile.yaml @@ -92,14 +92,14 @@ tasks: GOARCH: amd64 test:example:linux: - summary: Build example for Linux with GTK3 (default) + summary: Build example for Linux (pass BUILD_TAGS env var to add -tags, e.g. BUILD_TAGS=gtk4) dir: 'examples/{{.DIR}}' platforms: - linux cmds: - - echo "Building example {{.DIR}} for Linux (GTK3)" + - echo "Building example {{.DIR}} for Linux (${BUILD_TAGS:-GTK3})" - go mod tidy - - go build -o "testbuild-{{.DIR}}-linux" + - go build ${BUILD_TAGS:+-tags $BUILD_TAGS} -o "testbuild-{{.DIR}}-linux" test:example:linux:gtk4: summary: Build example for Linux with GTK4 (experimental, opt-in via -tags gtk4) @@ -365,12 +365,7 @@ tasks: vars: DIR: "{{.ITEM}}" platforms: [linux] - # GTK4 tests are run separately via Docker tasks since CI doesn't have GTK4 deps - # - for: { var: EXAMPLEDIRS } - # task: test:example:linux:gtk4 - # vars: - # DIR: "{{.ITEM}}" - # platforms: [linux] + # GTK4 example builds are handled in CI via: BUILD_TAGS=gtk4 task test:examples - for: { var: EXAMPLEDIRS } task: test:example:windows vars: diff --git a/v3/UNRELEASED_CHANGELOG.md b/v3/UNRELEASED_CHANGELOG.md index 823ba99b8..fbd0259cf 100644 --- a/v3/UNRELEASED_CHANGELOG.md +++ b/v3/UNRELEASED_CHANGELOG.md @@ -25,6 +25,7 @@ After processing, the content will be moved to the main changelog and this file ## Fixed +- Fix GTK4 build failure caused by C `Screen` typedef colliding with X11 Xlib.h (#4957) - Fix dock badge methods consistency on macOS ## Deprecated diff --git a/v3/pkg/application/linux_cgo_gtk4.h b/v3/pkg/application/linux_cgo_gtk4.h index ff1d6a93a..81126e98a 100644 --- a/v3/pkg/application/linux_cgo_gtk4.h +++ b/v3/pkg/application/linux_cgo_gtk4.h @@ -29,22 +29,6 @@ typedef struct WindowEvent { uint event; } WindowEvent; -typedef struct Screen { - const char* id; - const char* name; - int p_width; - int p_height; - int x; - int y; - int w_width; - int w_height; - int w_x; - int w_y; - float scaleFactor; - double rotation; - bool isPrimary; -} Screen; - typedef struct MenuItemData { guint id; GSimpleAction *action;