Compare commits
536 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e9c6171b6 | |||
| db1cb04896 | |||
| 4f81b5cd91 | |||
| f297e9198d | |||
| b56ce02e0c | |||
| aae92380a1 | |||
| c06a593b57 | |||
| ac69c05a31 | |||
| bfe201d70a | |||
| 1282cac99d | |||
| 784b236964 | |||
| f8206f18b1 | |||
| 523d5121d3 | |||
| a048da02d5 | |||
| 4d30400987 | |||
| f56a5ee260 | |||
| 891d4e9da3 | |||
| 8780cde919 | |||
| 56f6ac5fcc | |||
| 03b97b0a8b | |||
| 3d30790280 | |||
| 20ecaaa0e1 | |||
| b201438b39 | |||
| dca64da1fe | |||
| ca34428d17 | |||
| 5f13ee0afe | |||
| d11cde0c1c | |||
| 052b7d0ca7 | |||
| 22960c5c20 | |||
| d68898a033 | |||
| 5c6aa76979 | |||
| abefce0961 | |||
| 2ca1fe61a4 | |||
| d3316a37ed | |||
| 6fd951e53d | |||
| 35adc7ed04 | |||
| 52eb7b23cb | |||
| 6f4ebce914 | |||
| 40295441d1 | |||
| d2fe033c21 | |||
| e3c03e98f9 | |||
| 85d34932f3 | |||
| a0818f5bae | |||
| de3e97309f | |||
| d07bfbec1d | |||
| 89f3273651 | |||
| a612a42c11 | |||
| ddb9bae3d4 | |||
| a8c12a4c96 | |||
| b31a80cd64 | |||
| 6748c7116d | |||
| d13b9f797a | |||
| 0b1ca619a7 | |||
| 16ac1a12fc | |||
| 6fee66a9aa | |||
| aec4dc9387 | |||
| 0a9e2d6ed7 | |||
| 395b30dcfe | |||
| 326d101a57 | |||
| 02a02fac56 | |||
| 7ab4c9a68b | |||
| 19a740e277 | |||
| cae5e60113 | |||
| c87b21351c | |||
| f25a5f21fc | |||
| bda6c5ec2b | |||
| 51cef47835 | |||
| f8b7bd6dd6 | |||
| 72b047b084 | |||
| 72eb09f8e8 | |||
| 7647208fba | |||
| 8f325b475b | |||
| ac7dd63b02 | |||
| a7b93d62d5 | |||
| 985e17772b | |||
| 856fb75413 | |||
| 138f104fa4 | |||
| 79e512ab0b | |||
| 91343251b9 | |||
| ecd6b0b9a4 | |||
| de6498f18c | |||
| f89aeecc4f | |||
| eec24a0982 | |||
| a4ab1cfebe | |||
| ba845fa7b2 | |||
| 2a89189f1a | |||
| 0165cce645 | |||
| 6c5489ab25 | |||
| b933d57632 | |||
| c4f8eb7ec9 | |||
| 7208c97c7d | |||
| 69e7ab649c | |||
| 59dfeaceff | |||
| de8329b3ce | |||
| 4d410489c5 | |||
| 4ffe5a4954 | |||
| 850a086adb | |||
| 76b7f2704c | |||
| b8af685a43 | |||
| 50c4fbff72 | |||
| 0bbe4150a8 | |||
| 6da446c1be | |||
| 8f44694d2c | |||
| cf7f7df10c | |||
| 1d62a010ef | |||
| 46cf2849d2 | |||
| 811c7f2266 | |||
| a84b41abfd | |||
| dab79f5d77 | |||
| e792e077fa | |||
| ba31560970 | |||
| cfd21b0991 | |||
| ebda6125a4 | |||
| a1757170da | |||
| 13f6790fdb | |||
| bd4b55ddbf | |||
| 2560af284d | |||
| 0f0dad24f4 | |||
| 9536d3aeaa | |||
| 9cfda52d22 | |||
| 628d94936a | |||
| a91de44755 | |||
| d955636da5 | |||
| f4c366044b | |||
| 847d378fea | |||
| fab2558747 | |||
| 0ac222fab2 | |||
| 6f6b5faaa2 | |||
| ddb7cab4ac | |||
| c5d39c3582 | |||
| aeba990793 | |||
| a51e5551ba | |||
| b46f50079b | |||
| 715dc780fd | |||
| d0b09a8823 | |||
| 146229bd47 | |||
| 1eee1980ed | |||
| 7072d57d12 | |||
| 57b0ac9b42 | |||
| 2e7c6edca8 | |||
| 2674a3a9d4 | |||
| 8d1a37757d | |||
| 7fd47a81e1 | |||
| b7df2c7172 | |||
| 7ee6fb2ec0 | |||
| b34cfc89e6 | |||
| 40af368523 | |||
| 69b43edd55 | |||
| 8d5357ee56 | |||
| c91e65ba10 | |||
| df670047ea | |||
| 989b8ef34a | |||
| d3d9788d71 | |||
| bd2b635b6e | |||
| c4c00461fe | |||
| 33059211f4 | |||
| cec7ff1ba7 | |||
| 88e8a5272e | |||
| 4d5368e56e | |||
| f6e3dfd73e | |||
| 02d1d9714e | |||
| 0eda000cef | |||
| 9f04a52b51 | |||
| f308d2877e | |||
| cbfc2f7443 | |||
| 9a693c7228 | |||
| 5bd8f8c5a3 | |||
| d3cd68f11d | |||
| 96f403d608 | |||
| a1ed9d2a4a | |||
| 47d25d8b97 | |||
| d4943ef2fb | |||
| abe4225d9d | |||
| 8ad9958737 | |||
| 1ec3ed966d | |||
| 3f5f1ec957 | |||
| 045517ae9c | |||
| c989d87c74 | |||
| 954af8f0bb | |||
| e35378ba37 | |||
| 90b737529d | |||
| 2b73b35981 | |||
| 24f9cc76c0 | |||
| c28e247e87 | |||
| 5d9646810f | |||
| bcc2d455e4 | |||
| e1fa808a33 | |||
| e9e8a7b73b | |||
| 2f635ad61b | |||
| 81f19a011b | |||
| 041a4c202b | |||
| ad03ab2ebb | |||
| 8497f07124 | |||
| 0fd8168b3a | |||
| 059137f714 | |||
| 8d2542c867 | |||
| 1c07a20ca4 | |||
| 7284ec12d9 | |||
| ea45c02561 | |||
| 4b6ce6b231 | |||
| 2b983539bb | |||
| 268ca8784d | |||
| 8cafaebe8b | |||
| 0372d98159 | |||
| 498d513c4b | |||
| d1ea91c650 | |||
| 9cec4fd7fd | |||
| 84cfbe3491 | |||
| bdd4cc6661 | |||
| d54b622573 | |||
| a184b5bf51 | |||
| 3d273cc073 | |||
| a04204855d | |||
| 4445dfcbc3 | |||
| be5c0a2fe2 | |||
| 016e8c55ab | |||
| 33829cdec9 | |||
| ec1a48e830 | |||
| 96fd5a24db | |||
| d4868da99c | |||
| e85a298528 | |||
| dfbafa27e7 | |||
| cd673a95c1 | |||
| b543567c9e | |||
| e2d05f0625 | |||
| 4efd805110 | |||
| 39fb8d3cec | |||
| a98001978c | |||
| d2dd065b95 | |||
| f26c026aaf | |||
| bea26415d8 | |||
| bac71be6bb | |||
| 63127d6902 | |||
| a57047c289 | |||
| 3795d0ad8c | |||
| 4e02e292a6 | |||
| c67e3f37da | |||
| b1bbb37154 | |||
| e6209de962 | |||
| c2bc13b8b9 | |||
| 1b3756869a | |||
| 06396838f9 | |||
| 448babd29e | |||
| 3352a9d3bc | |||
| 88efe7f853 | |||
| de04aaf82d | |||
| 963e5dd0c8 | |||
| 1dcd916c7e | |||
| 3caa5bd4fe | |||
| 6a97b1ff27 | |||
| 72513972d7 | |||
| 1ce4f4c514 | |||
| 26f36fcb2a | |||
| e25d5d89d8 | |||
| 629431ba0e | |||
| 653251f69e | |||
| ebafe781b4 | |||
| 22af449b46 | |||
| 007243c151 | |||
| 9574f961c3 | |||
| 69135bcfe3 | |||
| 0d30d36326 | |||
| cc65c67a0d | |||
| 52b2148b28 | |||
| c09b9904c8 | |||
| 2427ebf9ba | |||
| ccc30804d2 | |||
| a0e7a231a8 | |||
| ec1e2fac95 | |||
| d5b42f78aa | |||
| ffe2df7b6a | |||
| d1dcf88d75 | |||
| a3ed7a150b | |||
| 55f46809de | |||
| 0cbeee3857 | |||
| 2dca4e310d | |||
| 844555384b | |||
| 522e5d4fa5 | |||
| 63a0e76646 | |||
| 607b859a0b | |||
| 72d80b8002 | |||
| 5b81864211 | |||
| 9bf9c76365 | |||
| 5413892b7d | |||
| e6f05da6ef | |||
| 1feb169bfa | |||
| dd5fd12343 | |||
| 6f54881851 | |||
| b4d17ebcbe | |||
| 8e99b3f079 | |||
| 4da9692061 | |||
| c80ac1c05d | |||
| 245c67c8c9 | |||
| b1fe8b5ab4 | |||
| e363b3a23c | |||
| c5fe16caa6 | |||
| cadd794d2c | |||
| e0da315783 | |||
| 7733159540 | |||
| 7a90d4b7c3 | |||
| b5f73f1426 | |||
| b4d120fcb4 | |||
| 6ab0addc64 | |||
| b999c8d826 | |||
| 0ebceebe37 | |||
| 3dd3695ac4 | |||
| 6c911248c9 | |||
| 4b953dee70 | |||
| f8e043b864 | |||
| 19a9718542 | |||
| 2b74662b2b | |||
| faa748d4c9 | |||
| 98996aa60b | |||
| b8b966ef80 | |||
| 5e50b493ec | |||
| 1bc6f7ef47 | |||
| 74ff79ef60 | |||
| 30b2e1e7a3 | |||
| bf2d6ab5d6 | |||
| 8b5bddcecc | |||
| 18f56ddf53 | |||
| 8d21c14592 | |||
| c68329819a | |||
| 1ed30e7394 | |||
| b592ded80a | |||
| ab4b85f88c | |||
| d9b436535a | |||
| 8df0c81807 | |||
| 87dfcd8152 | |||
| badbde5041 | |||
| a3e4481959 | |||
| 0b63509d13 | |||
| c76896dadf | |||
| 09819e75d2 | |||
| d839742415 | |||
| 1118708976 | |||
| da7b0af94b | |||
| 40bbcfebcb | |||
| 804ae299a7 | |||
| 79762f0be2 | |||
| de348ba984 | |||
| 04ed7fe7db | |||
| c6036592c9 | |||
| 3f5cf71039 | |||
| c884308da3 | |||
| ae97f04498 | |||
| 0e30a96404 | |||
| 114f374623 | |||
| 7d9a939f99 | |||
| a3ad7fa80f | |||
| 665f8b6b87 | |||
| 947c3e9f72 | |||
| 7a5caf1bc0 | |||
| 3065f47ab5 | |||
| 46a7ffc336 | |||
| 7638bcc8e9 | |||
| cf91cf4825 | |||
| b80bc06b99 | |||
| 40fc27fd55 | |||
| 4c98203d91 | |||
| f1d1d24369 | |||
| 4e8d8724b6 | |||
| 7df7d6dca7 | |||
| 9459be11a9 | |||
| fb998ff52d | |||
| d59b28d5f4 | |||
| 996e22bde9 | |||
| 99472280fb | |||
| 1573ff6803 | |||
| c7c404833f | |||
| 3466bfdf2d | |||
| 87721d0da7 | |||
| d60746ae6c | |||
| e9c4c80102 | |||
| ede4d06192 | |||
| 5762cc0958 | |||
| 7998c53396 | |||
| 52d944ec44 | |||
| 7fd126e2af | |||
| e169c35613 | |||
| 366374a3a0 | |||
| 92f11144f3 | |||
| 2b96159c9d | |||
| 60f69462fc | |||
| 6a507c0b63 | |||
| 1a598c32d9 | |||
| 687b49c18a | |||
| ac30f9b4cc | |||
| c03480cbd3 | |||
| e930c7ef64 | |||
| baddc90c26 | |||
| 31ae4096b5 | |||
| 1f8c019d1e | |||
| aed01a338e | |||
| cb9b7278d6 | |||
| 34d85329a9 | |||
| b510de34ea | |||
| 88fc1640ed | |||
| 45a5ffd056 | |||
| df8e6ea32e | |||
| ae776046fc | |||
| 5858f7c5bd | |||
| 99031f885e | |||
| 85473d942c | |||
| 05df57654f | |||
| ecbed15d47 | |||
| 0e8eedee16 | |||
| c15eb34792 | |||
| 5c73b870c1 | |||
| 948782b7e5 | |||
| a94753429c | |||
| 97f540622a | |||
| 0efc217dda | |||
| 28d6c19135 | |||
| 44d2e6a0f4 | |||
| 4f7c3610d6 | |||
| 8a60e251f4 | |||
| 4db3f142d7 | |||
| 177aeca5a1 | |||
| 530f0c0300 | |||
| 9a46b17a8b | |||
| 69334021a2 | |||
| 1906ed0df5 | |||
| 625035e214 | |||
| f67bad2346 | |||
| 8b9ce87fc7 | |||
| 628245fbf5 | |||
| c823a4d673 | |||
| 0ee7d8bc7c | |||
| adf0cdad05 | |||
| 373dd2a27e | |||
| 6d9a3e3ade | |||
| 9151187e3e | |||
| 86b0b80dfa | |||
| b59aa9af37 | |||
| f28c6d34a7 | |||
| 1a9aa675e4 | |||
| 721ce22a86 | |||
| c3b912722e | |||
| 503ec2fdb7 | |||
| cd78e080b1 | |||
| 1e2d72144a | |||
| 0576aff947 | |||
| c2f51e1de6 | |||
| 2e2e22a270 | |||
| 00aaba4d5b | |||
| c348d78e37 | |||
| db39ce2b16 | |||
| 53a481b01b | |||
| 521a382d79 | |||
| 3b5e10ef4d | |||
| 326077d2ed | |||
| 95fd38426c | |||
| 217158995a | |||
| 00f06f2480 | |||
| 83ebdbdbf4 | |||
| e6e86176dc | |||
| 1697be5e44 | |||
| be159ab93c | |||
| d46aa9f49e | |||
| e12747870b | |||
| 16b4ae8486 | |||
| 1f9f370346 | |||
| 30906f3240 | |||
| 35b9677006 | |||
| 8f7f6bffbc | |||
| fc3bb14b82 | |||
| d36da44f2b | |||
| 95ea8fd932 | |||
| 93faac9d8e | |||
| bcf08abef0 | |||
| 15d71079fe | |||
| 01ca0d2f53 | |||
| 7c343a87d1 | |||
| 74a630321b | |||
| a79c1f40c6 | |||
| 609fb27e11 | |||
| d78d8b245f | |||
| 633f0fa52a | |||
| 3483a3e134 | |||
| 27d7f55aba | |||
| 3236c09d7d | |||
| 98918b689e | |||
| 25c2b8693a | |||
| 0459569b49 | |||
| 5c7fca7405 | |||
| 9ea19ea9b0 | |||
| e6ff990145 | |||
| c8d058137a | |||
| 48088579d8 | |||
| 7360d470c9 | |||
| 73737bcc4f | |||
| dea11781a5 | |||
| e51cfe2349 | |||
| d536fa5aa4 | |||
| 476afca97d | |||
| 0352d88b8a | |||
| adc2f4ad9e | |||
| 15737d7a94 | |||
| a1f43f53b4 | |||
| a2b101ba5b | |||
| f9decb0cd6 | |||
| 85389c4bcf | |||
| 23d6764a6d | |||
| f8dd5b6b84 | |||
| c37bbb2641 | |||
| 76b87660ba | |||
| a5dc7bbfc1 | |||
| cf060b4c7d | |||
| 99bae0fb5f | |||
| 67866bd8bc | |||
| b35cd705a7 | |||
| c5d9c8be2b | |||
| cdd4349bfe | |||
| f06ee688fe | |||
| 92aa63c203 | |||
| dc79e07228 | |||
| 46165b52e5 | |||
| e6ec3f4b95 | |||
| 814d1e7f06 | |||
| 2e5f344e3c | |||
| a4984cfd40 | |||
| 26c75f31f4 | |||
| 7fedb39b4b | |||
| 5a52af20cb | |||
| 12fc9a45ef | |||
| 01d4c29ce3 | |||
| 8c97702a07 | |||
| 5a0891c69d | |||
| 392d4de8a9 | |||
| 4ce11106c8 | |||
| e278f38905 | |||
| 6d98edf89f | |||
| b9e1ef1558 | |||
| 2aa62b31b4 | |||
| 66bd6d88de |
@@ -64,30 +64,30 @@ reference:
|
||||
- gdk3-docs.tar.xz
|
||||
- gtk3-docs.tar.xz
|
||||
|
||||
msys2-mingw32-meson:
|
||||
msys2-mingw64-meson:
|
||||
variables:
|
||||
MSYSTEM: "MINGW32"
|
||||
MSYSTEM: "MINGW64"
|
||||
CHERE_INVOKING: "yes"
|
||||
stage: build
|
||||
tags:
|
||||
- win32
|
||||
- win32-ps
|
||||
script:
|
||||
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu
|
||||
- C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2-meson.sh"
|
||||
artifacts:
|
||||
when: always
|
||||
name: "gtk3-%CI_JOB_NAME%-%CI_COMMIT_REF_NAME%"
|
||||
name: "gtk3-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
|
||||
paths:
|
||||
- "_build/meson-logs"
|
||||
|
||||
msys2-mingw32-autotools:
|
||||
msys2-mingw64-autotools:
|
||||
when: manual
|
||||
variables:
|
||||
MSYSTEM: "MINGW32"
|
||||
MSYSTEM: "MINGW64"
|
||||
CHERE_INVOKING: "yes"
|
||||
stage: build
|
||||
tags:
|
||||
- win32
|
||||
- win32-ps
|
||||
script:
|
||||
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu
|
||||
- C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2-autotools.sh"
|
||||
|
||||
@@ -30,6 +30,9 @@ pacman --noconfirm -S --needed \
|
||||
mingw-w64-$MSYS2_ARCH-ninja \
|
||||
mingw-w64-$MSYS2_ARCH-gtk-doc
|
||||
|
||||
# https://github.com/msys2/MINGW-packages/pull/6465
|
||||
pacman --noconfirm -S --needed mingw-w64-$MSYS2_ARCH-brotli
|
||||
|
||||
mkdir -p _ccache
|
||||
export CCACHE_BASEDIR="$(pwd)"
|
||||
export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
SRC_SUBDIRS = gdk gtk libgail-util modules demos tests testsuite examples
|
||||
SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros build
|
||||
SUBDIRS = po po-properties $(SRC_SUBDIRS) docs m4macros win32
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
|
||||
|
||||
@@ -16,6 +16,7 @@ EXTRA_DIST += \
|
||||
NEWS.pre-1-0 \
|
||||
README.commits \
|
||||
README.win32 \
|
||||
check-version.py \
|
||||
config.h.win32 \
|
||||
makefile.msc \
|
||||
gtk-zip.sh.in \
|
||||
@@ -84,6 +85,7 @@ DISTCLEANFILES = \
|
||||
dist-hook:
|
||||
mkdir $(distdir)/subprojects
|
||||
cp -p $(srcdir)/subprojects/*.wrap $(distdir)/subprojects
|
||||
$(top_srcdir)/check-version.py $(top_srcdir)/configure.ac $(top_srcdir)/meson.build
|
||||
|
||||
distclean-local:
|
||||
if test "$(srcdir)" = "."; then :; else \
|
||||
|
||||
@@ -1,3 +1,313 @@
|
||||
Overview of Changes in GTK+ 3.24.26
|
||||
===================================
|
||||
|
||||
* Input:
|
||||
- Fix a few oversights in Compose file parsing
|
||||
- Fine-tune Compose preedit display
|
||||
|
||||
* Theme:
|
||||
- Fine-tune scrollbar size and transitions
|
||||
- Reinstate invisible borders for tiled windows
|
||||
|
||||
* Wayland:
|
||||
- Fix a problem with font settings not being found
|
||||
|
||||
* Translation updates
|
||||
French
|
||||
Hungarian
|
||||
Turkish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.24.25
|
||||
===================================
|
||||
|
||||
* Settings:
|
||||
- Make cursor aspect ratio setting work
|
||||
|
||||
* Broadway:
|
||||
- Fix touchscreen event handling
|
||||
- Support Android / Chrome on-screen keyboard
|
||||
|
||||
* Windows:
|
||||
- Fix issues with Intel graphics drivers
|
||||
- Avoid UAC for gtk-update-icon-cache
|
||||
|
||||
* Wayland:
|
||||
- Avoid crashes with tablet input
|
||||
- Add api to support clients with subsurfaces better
|
||||
|
||||
* Inspector:
|
||||
- Make the inspector available in non-debug builds
|
||||
|
||||
* Theme:
|
||||
- Make scrollbars larger
|
||||
- Disable shadows on maximized, fullscreen and tiled windows
|
||||
|
||||
* Printing:
|
||||
- Support Avahi-discovered printers better
|
||||
|
||||
* Input:
|
||||
- Show preedit for compose sequences
|
||||
- Support long compose sequences
|
||||
- Support compose sequences producing multiple characters
|
||||
|
||||
* Translation updates
|
||||
Belarusian
|
||||
British English
|
||||
Catalan
|
||||
Friulian
|
||||
Galician
|
||||
Japanese
|
||||
Persian
|
||||
Serbian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.24.24
|
||||
===================================
|
||||
|
||||
* GtkColorChooser:
|
||||
- Update the default color palette
|
||||
|
||||
* GtkFontChooser:
|
||||
- Fix family-only mode to return regular style
|
||||
|
||||
* GtkTreeView:
|
||||
- Don't set focus-on-click for header buttons
|
||||
|
||||
* Accessibility:
|
||||
- Implement scrollSubstringTo
|
||||
- Add a11y support to GtkPlug/GtkSocket
|
||||
|
||||
* Printing:
|
||||
- Allow the lpr backend to print pdf and ps files
|
||||
|
||||
* Theme:
|
||||
- Update gesture graphics
|
||||
- Update HighContrast css
|
||||
|
||||
* Wayland:
|
||||
- Support the primary-selection-unstable-v1 protocol
|
||||
|
||||
* X11:
|
||||
- Fix a crash with parent-relative backgrounds
|
||||
|
||||
* Broadway:
|
||||
- Set modifier state of scroll events
|
||||
|
||||
* Build:
|
||||
- Fix pc file generation on NixOS
|
||||
|
||||
* OS X:
|
||||
- Restore command-key bindings
|
||||
|
||||
* Windows:
|
||||
- Fix meson build with epoxy subproject
|
||||
|
||||
* Translation updates:
|
||||
Basque
|
||||
Brazilian Portuguese
|
||||
British English
|
||||
Catalan
|
||||
Croatian
|
||||
Czech
|
||||
French
|
||||
Galician
|
||||
German
|
||||
Greek
|
||||
Hebrew
|
||||
Hungarian
|
||||
Indonesian
|
||||
Italian
|
||||
Kazakh
|
||||
Latvian
|
||||
Lithuanian
|
||||
Persian
|
||||
Polish
|
||||
Portuguese
|
||||
Slovak
|
||||
Slovenian
|
||||
Spanish
|
||||
Swedish
|
||||
Turkish
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.24.23
|
||||
===================================
|
||||
|
||||
* Adwaita:
|
||||
- Support error states for labels and entries
|
||||
|
||||
* Printing:
|
||||
- Use the correct names for remote printers
|
||||
|
||||
* File choser:
|
||||
- Default to tracker2 for search to prevent
|
||||
symbol clashes in tracker-using applications
|
||||
|
||||
* Wayland:
|
||||
- Support newer schemas for settings
|
||||
- Fix DND hotspot handling
|
||||
- Disconnect on display close
|
||||
|
||||
* X11:
|
||||
- Fix a possible crash with disabled devices
|
||||
|
||||
* Translation updates:
|
||||
Basque
|
||||
Chinese (China)
|
||||
Croatian
|
||||
Dutch
|
||||
Finnish
|
||||
Friulian
|
||||
Galician
|
||||
Hungarian
|
||||
Japanese
|
||||
Korean
|
||||
Portuguese
|
||||
Serbian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.24.22
|
||||
===================================
|
||||
|
||||
* GtkTextView:
|
||||
- Fix some corner cases of pixelcache invalidation
|
||||
- Make select-all work on touch
|
||||
|
||||
* Fix print portal support
|
||||
|
||||
* Adwaita:
|
||||
- Tweak title style class
|
||||
- Add a public color for text view background
|
||||
|
||||
* Windows:
|
||||
- Limit the size of the corner mask cache
|
||||
- Use native API for keycode conversion
|
||||
- Use GLES on arm64
|
||||
|
||||
* Wayland: Add a way to change the application id
|
||||
|
||||
* Quartz: Add axes to master devices
|
||||
|
||||
* Add --enable-tracker3 option to configure
|
||||
|
||||
* Translation updates:
|
||||
Catalan
|
||||
German
|
||||
Indonesian
|
||||
Italian
|
||||
Kazakh
|
||||
Spanish
|
||||
Turkish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.24.21
|
||||
===================================
|
||||
|
||||
* Wayland:
|
||||
- Prevent crashes with offscreen windows
|
||||
- Handle disorderly tablet/pad disconnects
|
||||
|
||||
* GtkFileChooser:
|
||||
- Translate the type column
|
||||
- Add a tracker3 search engine
|
||||
- Rate-limit trash monitoring
|
||||
- Make get_filter work for native chooser
|
||||
|
||||
* GtkGLArea:
|
||||
- Fix a redraw problem
|
||||
|
||||
* GtkScrolledWindow:
|
||||
- Fix kinetic scrolling
|
||||
|
||||
* Add a gtk-cursor-aspect-ratio setting
|
||||
|
||||
* GDK:
|
||||
- Improve frame clock smoothness
|
||||
- Fix frame clock monotonicity
|
||||
|
||||
* OS X:
|
||||
- Support Pen / Eraser input
|
||||
- Support openfiles in GtkApplication
|
||||
|
||||
* Adwaita:
|
||||
- Improve notebook tab legibility
|
||||
|
||||
* Translation updates:
|
||||
Basque
|
||||
Brazilian Portuguese
|
||||
Catalan
|
||||
Chinese (Taiwan)
|
||||
German
|
||||
Indonesian
|
||||
Italian
|
||||
Japanese
|
||||
Kazakh
|
||||
Lithuanian
|
||||
Polish
|
||||
Romanian
|
||||
Slovak
|
||||
Slovenian
|
||||
Swedish
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.24.20
|
||||
===================================
|
||||
|
||||
* GtkFileChooser:
|
||||
- Prevent selection changes after overwrite confirmation
|
||||
- Don't grab focus to the sidebar on click
|
||||
- Avoid a use-after-free in GtkFileSystemModel
|
||||
|
||||
* GtkEmojiChooser:
|
||||
- Remove blacklist
|
||||
|
||||
* GtkAboutDialog:
|
||||
- Add more licenses
|
||||
|
||||
* Adwaita:
|
||||
- Lower the contrast of checkboxes
|
||||
|
||||
* HighContrast:
|
||||
- Export the same public colors as Adwaita
|
||||
|
||||
* OS X:
|
||||
- Don't filter Escape in input methods
|
||||
|
||||
* Windows:
|
||||
- Infer font settings from system settings
|
||||
|
||||
* Translation updates
|
||||
Brazilian Portuguese
|
||||
Chinese
|
||||
Croatian
|
||||
French
|
||||
Japanese
|
||||
Lithuanian
|
||||
Polish
|
||||
Spanish
|
||||
Swedish
|
||||
Turkish
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.24.18
|
||||
===================================
|
||||
|
||||
* Wayland:
|
||||
- Fix more sizing regressions in Epiphany and LibreOffice
|
||||
menus, and popups in general
|
||||
|
||||
* Build:
|
||||
- Make resource build reproducible
|
||||
|
||||
* Translation updates
|
||||
Basque
|
||||
Latvian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.24.17
|
||||
===================================
|
||||
|
||||
|
||||
@@ -10,15 +10,13 @@ First you obviously need developer packages for the compile-time
|
||||
dependencies: GDK-Pixbuf, Pango, atk, glib, gettext-runtime, libiconv at least.
|
||||
See http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies .
|
||||
|
||||
For people compiling GTK+ with Visual C++ 2005 or later, it is
|
||||
recommended that the same compiler is used for at least GDK-Pixbuf,
|
||||
Pango, atk and glib so that crashes and errors caused by different CRTs
|
||||
can be avoided. The VS 2008 project files and/or VS Makefiles are
|
||||
either already available or will be available in the next stable release.
|
||||
Unfortunately compiling with Microsoft's compilers versions 2003 or earlier
|
||||
is not supported as compiling the latest stable GLib (which *is* required for
|
||||
building this GTK+ release) requires features from newer compilers
|
||||
and/or Platform SDKs
|
||||
For people compiling GTK+ with Visual C++ or later, it is recommended that
|
||||
the same compiler is used for at least GDK-Pixbuf, Pango, atk and glib
|
||||
so that crashes and errors caused by different CRTs can be avoided. Currently
|
||||
building with Visual Studio 2008 or later is supported, either via Visual Studio
|
||||
project files or via the Meson build system, as described in the below sections.
|
||||
Interchanging between Visual Studio 2015, 2017 and 2019 builds should be fine
|
||||
as they use the same CRT (UCRT) DLLs.
|
||||
|
||||
After installing the dependencies, there are two ways to build GTK+
|
||||
for win32.
|
||||
@@ -152,16 +150,12 @@ would require such for ABI stability).
|
||||
2) Microsoft's tools
|
||||
--------------------
|
||||
|
||||
Use the Microsoft compiler, cl and Make, nmake. Say nmake -f
|
||||
makefile.msc in gdk and gtk. Be prepared to manually edit various
|
||||
makefile.msc files, and the makefile snippets in build/win32.
|
||||
|
||||
There are also VS 2008~2017 solution and project files to build GTK+, which
|
||||
There are VS 2008~2019 solution and project files to build GTK+, which
|
||||
are maintained by Chun-wei Fan. They should build GTK+ out of the box,
|
||||
provided that the afore-mentioned dependencies are installed. They will
|
||||
build GDK with the Win32 backend, GTK+ itself (with GAIL/a11y built in),
|
||||
the GAIL-Util library and the gtk-demo program. Please also refer to the
|
||||
README file(s) that reside in build/win32 on how to enable additional features
|
||||
README file(s) that reside in win32 on how to enable additional features
|
||||
that are not enabled by default, such as EGL support via libANGLE, which
|
||||
emulate the GL/EGL calls using Direct3D 9/11.
|
||||
|
||||
@@ -181,6 +175,27 @@ instance the makefile.msc files might not produce identically named
|
||||
DLLs and import libraries as the "autoconfiscated" makefiles and
|
||||
libtool do. If this bothers you, you will have to fix the makefiles.
|
||||
|
||||
If desiring to build binaries for ARM64 (aarch64), one needs to use the
|
||||
Visual Studio 2017 or 2019 solution files, or use Meson with a
|
||||
cross-compilation file, with a Windows 10 SDK that supports ARM64
|
||||
builds. At this point, building the introspection files is not supported
|
||||
for ARM64 builds, and you will need a Python interpreter and
|
||||
glib-compile-resources binaries that run on the build machine. For Visual Studio
|
||||
2017 ARM64 builds, do also check the Directory.Build.props file in $(srcroot)/win32/vs15
|
||||
indicates a Windows 10 SDK version that supports ARM64 builds exists on the build machine.
|
||||
|
||||
For building ARM64 binaries with the Visual Studio projects, prior to the build,
|
||||
you may need to update gtk3-gen-srcs.props to pass in the variables GLIB_MKENUMS,
|
||||
GLIB_GENMARSHAL, GDBUS_CODEGEN and/or GLIB_COMPILE_RESOURCES in the nmake command line
|
||||
indicated by <GenerateRequiredSourcesBase> so that they point to the glib-mkenums,
|
||||
glib-genmarshal, gdbus-codegen and glib-compile-resources that will run on the build
|
||||
machine. You may also need to update gtk3-version-paths.props to update PythonDir to
|
||||
the installation of the Python interpreter that will run on the build machine. To carry
|
||||
out the actual build using the solution files, use the "Configuration Manager" to add the
|
||||
ARM64 build configs by copying the settings from the x64 configs, and then build the solution.
|
||||
The build instructions for such builds otherwise follow the standard Win32 (x86) and
|
||||
x64 builds, but you need to ensure that you have ARM64 builds of the various dependencies.
|
||||
|
||||
3) Using Meson (for Visual Studio and MinGW builds)
|
||||
---
|
||||
|
||||
|
||||
@@ -27,7 +27,13 @@ if 'DESTDIR' not in os.environ:
|
||||
shutil.copyfile(installed_lib, installed_lib_dst)
|
||||
|
||||
print('Compiling GSettings schemas...')
|
||||
subprocess.call(['glib-compile-schemas',
|
||||
glib_compile_schemas = subprocess.check_output(['pkg-config',
|
||||
'--variable=glib_compile_schemas',
|
||||
'gio-2.0']).strip()
|
||||
if not os.path.exists(glib_compile_schemas):
|
||||
# pkg-config variables only available since GLib 2.62.0.
|
||||
glib_compile_schemas = 'glib-compile-schemas'
|
||||
subprocess.call([glib_compile_schemas,
|
||||
os.path.join(gtk_datadir, 'glib-2.0', 'schemas')])
|
||||
|
||||
print('Updating icon cache...')
|
||||
@@ -43,4 +49,10 @@ if 'DESTDIR' not in os.environ:
|
||||
# Untested!
|
||||
print('Updating module cache for print backends...')
|
||||
os.makedirs(gtk_printmodule_dir, exist_ok=True)
|
||||
subprocess.call(['gio-querymodules', gtk_printmodule_dir])
|
||||
gio_querymodules = subprocess.check_output(['pkg-config',
|
||||
'--variable=gio_querymodules',
|
||||
'gio-2.0']).strip()
|
||||
if not os.path.exists(gio_querymodules):
|
||||
# pkg-config variables only available since GLib 2.62.0.
|
||||
gio_querymodules = 'gio-querymodules'
|
||||
subprocess.call([gio_querymodules, gtk_printmodule_dir])
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
# Centralized autotools file
|
||||
# Create the Visual Studio 2012/2013/2015 project files
|
||||
# from the Visual Studio 2010 project files
|
||||
|
||||
# This autotools file, from GLib, can be used in other projects
|
||||
# that have Visual Studio build support, and is copied into
|
||||
# $(srcroot)/build/.
|
||||
|
||||
# Author: Fan, Chun-wei
|
||||
# November 05, 2012
|
||||
|
||||
# MSVC_VER_LONG: Long Version of target Visual Studio (2012, 2013, 14 and so on)
|
||||
# MSVC_VER: Short Version of target Visual Studio (110 for 2012, 120 for 2013, 140 for 2015, 141 for 2017)
|
||||
# MSVC_TOOLSET: Use if target MSVC toolsett is not in the form v $(MSVC_VER)0, meaning v$(MSVC_TOOLSET)
|
||||
|
||||
if MSVC_BASE_NO_TOOLSET_SET
|
||||
MSVC_BASE_TOOLSET = $(MSVC_BASE_VER)0
|
||||
endif
|
||||
|
||||
if MSVC_NO_TOOLSET_SET
|
||||
MSVC_TOOLSET = $(MSVC_VER)0
|
||||
endif
|
||||
|
||||
%.sln: $(top_builddir)/build/win32/vs10/Makefile
|
||||
sed 's/11\.00/$(MSVC_FORMAT_VER)\.00/g' < $(top_srcdir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp
|
||||
sed 's/2010/$(MSVC_VER_LONG)/g' < $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@
|
||||
rm $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp
|
||||
|
||||
%.txt: $(top_builddir)/build/win32/vs10/Makefile
|
||||
sed 's/vs10/vs$(MSVC_VER)/g' < $(top_srcdir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp
|
||||
sed 's/VS10/VS$(MSVC_VER)/g' < $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@
|
||||
rm $(top_builddir)/build/win32/vs$(MSVC_VER)/$@.tmp
|
||||
|
||||
%.vcxproj: $(top_builddir)/build/win32/vs10/Makefile
|
||||
if test -e $(top_srcdir)/build/win32/vs10/$@; then \
|
||||
sed 's/v100/v$(MSVC_TOOLSET)/g' < $(top_srcdir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
|
||||
else \
|
||||
sed 's/v100/v$(MSVC_TOOLSET)/g' < $(top_builddir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
|
||||
fi
|
||||
|
||||
%.props: $(top_builddir)/build/win32/vs10/Makefile
|
||||
if test -e $(top_srcdir)/build/win32/vs10/$@; then \
|
||||
sed 's/<VSVer>10<\/VSVer>/<VSVer>$(MSVC_VER)<\/VSVer>/g' < $(top_srcdir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
|
||||
else \
|
||||
sed 's/<VSVer>10<\/VSVer>/<VSVer>$(MSVC_VER)<\/VSVer>/g' < $(top_builddir)/build/win32/vs10/$@ > $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
|
||||
fi
|
||||
|
||||
%.vcxproj.filters: $(top_builddir)/build/win32/vs10/Makefile
|
||||
if test -e $(top_srcdir)/build/win32/vs10/$@; then \
|
||||
cp $(top_srcdir)/build/win32/vs10/$@ $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
|
||||
else \
|
||||
cp $(top_builddir)/build/win32/vs10/$@ $(top_builddir)/build/win32/vs$(MSVC_VER)/$@; \
|
||||
fi
|
||||
@@ -1,5 +0,0 @@
|
||||
include $(top_srcdir)/Makefile.decl
|
||||
|
||||
SUBDIRS = win32
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
@@ -1,222 +0,0 @@
|
||||
# NMake Makefile portion for code generation and
|
||||
# intermediate build directory creation
|
||||
# Items in here should not need to be edited unless
|
||||
# one is maintaining the NMake build files.
|
||||
|
||||
!include config-msvc.mak
|
||||
!include create-lists-msvc.mak
|
||||
|
||||
# Copy the pre-defined gdkconfig.h.[win32|win32_broadway]
|
||||
!if "$(CFG)" == "release" || "$(CFG)" == "Release"
|
||||
GDK_OLD_CFG = debug
|
||||
!else
|
||||
GDK_OLD_CFG = release
|
||||
!endif
|
||||
|
||||
!ifdef BROADWAY
|
||||
GDK_CONFIG = broadway
|
||||
GDK_DEL_CONFIG = win32
|
||||
GDK_CONFIG_TEMPLATE = ..\..\gdk\gdkconfig.h.win32_broadway
|
||||
!else
|
||||
GDK_CONFIG = win32
|
||||
GDK_DEL_CONFIG = broadway
|
||||
GDK_CONFIG_TEMPLATE = ..\..\gdk\gdkconfig.h.win32
|
||||
!endif
|
||||
|
||||
GDK_MARSHALERS_FLAGS = --prefix=_gdk_marshal --valist-marshallers
|
||||
GDK_RESOURCES_ARGS = ..\..\gdk\gdk.gresource.xml --target=$@ --sourcedir=..\..\gdk --c-name _gdk --manual-register
|
||||
GTK_MARSHALERS_FLAGS = --prefix=_gtk_marshal --valist-marshallers
|
||||
GTK_RESOURCES_ARGS = ..\..\gtk\gtk.gresource.xml --target=$@ --sourcedir=..\..\gtk --c-name _gtk --manual-register
|
||||
|
||||
all: \
|
||||
..\..\config.h \
|
||||
..\..\gdk\gdkconfig.h \
|
||||
..\..\gdk\gdkversionmacros.h \
|
||||
..\..\gdk\gdkmarshalers.h \
|
||||
..\..\gdk\gdkmarshalers.c \
|
||||
..\..\gdk\gdkresources.h \
|
||||
..\..\gdk\gdkresources.c \
|
||||
..\..\gtk\gtk-win32.rc \
|
||||
..\..\gtk\libgtk3.manifest \
|
||||
..\..\gtk\gtkdbusgenerated.h \
|
||||
..\..\gtk\gtkdbusgenerated.c \
|
||||
..\..\gtk\gtktypefuncs.inc \
|
||||
..\..\gtk\gtk.gresource.xml \
|
||||
..\..\gtk\gtkmarshalers.h \
|
||||
..\..\gtk\gtkmarshalers.c \
|
||||
..\..\gtk\gtkresources.h \
|
||||
..\..\gtk\gtkresources.c \
|
||||
..\..\demos\gtk-demo\demos.h \
|
||||
..\..\demos\gtk-demo\demo_resources.c \
|
||||
..\..\demos\icon-browser\resources.c
|
||||
|
||||
# Copy the pre-defined config.h.win32 and demos.h.win32
|
||||
..\..\config.h: ..\..\config.h.win32
|
||||
..\..\demos\gtk-demo\demos.h: ..\..\demos\gtk-demo\demos.h.win32
|
||||
..\..\gtk\gtk-win32.rc: ..\..\gtk\gtk-win32.rc.body
|
||||
|
||||
..\..\gdk-$(CFG)-$(GDK_CONFIG)-build: $(GDK_CONFIG_TEMPLATE)
|
||||
@if exist ..\..\gdk-$(GDK_OLD_CFG)-$(GDK_DEL_CONFIG)-build del ..\..\gdk-$(GDK_OLD_CFG)-$(GDK_DEL_CONFIG)-build
|
||||
@if exist ..\..\gdk-$(GDK_OLD_CFG)-$(GDK_CONFIG)-build del ..\..\gdk-$(GDK_OLD_CFG)-$(GDK_CONFIG)-build
|
||||
@if exist ..\..\gdk-$(CFG)-$(GDK_DEL_CONFIG)-build del ..\..\gdk-$(CFG)-$(GDK_DEL_CONFIG)-build
|
||||
@copy $** $@
|
||||
|
||||
..\..\gdk\gdkconfig.h: ..\..\gdk-$(CFG)-$(GDK_CONFIG)-build
|
||||
|
||||
..\..\config.h \
|
||||
..\..\gdk\gdkconfig.h \
|
||||
..\..\gtk\gtk-win32.rc \
|
||||
..\..\demos\gtk-demo\demos.h:
|
||||
@echo Copying $@...
|
||||
@copy $** $@
|
||||
|
||||
..\..\gdk\gdkversionmacros.h: ..\..\gdk\gdkversionmacros.h.in
|
||||
@echo Generating $@...
|
||||
@$(PYTHON) gen-gdkversionmacros-h.py --version=$(GTK_VERSION)
|
||||
|
||||
..\..\gdk\gdkmarshalers.h: ..\..\gdk\gdkmarshalers.list
|
||||
@echo Generating $@...
|
||||
@$(PYTHON) $(GLIB_GENMARSHAL) $(GDK_MARSHALERS_FLAGS) --header $** > $@.tmp
|
||||
@move $@.tmp $@
|
||||
|
||||
..\..\gdk\gdkmarshalers.c: ..\..\gdk\gdkmarshalers.list
|
||||
@echo Generating $@...
|
||||
@$(PYTHON) $(GLIB_GENMARSHAL) $(GDK_MARSHALERS_FLAGS) --body $** > $@.tmp
|
||||
@move $@.tmp $@
|
||||
|
||||
..\..\gdk\gdk.gresource.xml: $(GDK_RESOURCES)
|
||||
@echo Generating $@...
|
||||
@echo ^<?xml version='1.0' encoding='UTF-8'?^> >$@
|
||||
@echo ^<gresources^> >> $@
|
||||
@echo ^<gresource prefix='/org/gtk/libgdk'^> >> $@
|
||||
@for %%f in (..\..\gdk\resources\glsl\*.glsl) do @echo ^<file alias='glsl/%%~nxf'^>resources/glsl/%%~nxf^</file^> >> $@
|
||||
@echo ^</gresource^> >> $@
|
||||
@echo ^</gresources^> >> $@
|
||||
|
||||
..\..\gdk\gdkresources.h: ..\..\gdk\gdk.gresource.xml
|
||||
@echo Generating $@...
|
||||
@if not "$(XMLLINT)" == "" set XMLLINT=$(XMLLINT)
|
||||
@if not "$(JSON_GLIB_FORMAT)" == "" set JSON_GLIB_FORMAT=$(JSON_GLIB_FORMAT)
|
||||
@if not "$(GDK_PIXBUF_PIXDATA)" == "" set GDK_PIXBUF_PIXDATA=$(GDK_PIXBUF_PIXDATA)
|
||||
@$(GLIB_COMPILE_RESOURCES) $(GDK_RESOURCES_ARGS) --generate-header
|
||||
|
||||
..\..\gdk\gdkresources.c: ..\..\gdk\gdk.gresource.xml $(GDK_RESOURCES)
|
||||
@echo Generating $@...
|
||||
@if not "$(XMLLINT)" == "" set XMLLINT=$(XMLLINT)
|
||||
@if not "$(JSON_GLIB_FORMAT)" == "" set JSON_GLIB_FORMAT=$(JSON_GLIB_FORMAT)
|
||||
@if not "$(GDK_PIXBUF_PIXDATA)" == "" set GDK_PIXBUF_PIXDATA=$(GDK_PIXBUF_PIXDATA)
|
||||
@$(GLIB_COMPILE_RESOURCES) $(GDK_RESOURCES_ARGS) --generate-source
|
||||
|
||||
..\..\gtk\libgtk3.manifest: ..\..\gtk\libgtk3.manifest.in
|
||||
@echo Generating $@...
|
||||
@$(PYTHON) replace.py \
|
||||
--action=replace-var \
|
||||
--input=$** --output=$@ \
|
||||
--var=EXE_MANIFEST_ARCHITECTURE \
|
||||
--outstring=*
|
||||
|
||||
..\..\gtk\gtkdbusgenerated.h ..\..\gtk\gtkdbusgenerated.c: ..\..\gtk\gtkdbusinterfaces.xml
|
||||
@echo Generating GTK DBus sources...
|
||||
@$(PYTHON) $(PREFIX)\bin\gdbus-codegen \
|
||||
--interface-prefix org.Gtk. --c-namespace _Gtk \
|
||||
--generate-c-code gtkdbusgenerated $** \
|
||||
--output-directory $(@D)
|
||||
|
||||
..\..\gtk\gtktypefuncs.inc: ..\..\gtk\gentypefuncs.py
|
||||
@echo Generating $@...
|
||||
@echo #undef GTK_COMPILATION > $(@R).preproc.c
|
||||
@echo #include "gtkx.h" >> $(@R).preproc.c
|
||||
@cl /EP $(GTK_PREPROCESSOR_FLAGS) $(@R).preproc.c > $(@R).combined.c
|
||||
@$(PYTHON) $** $@ $(@R).combined.c
|
||||
@del $(@R).preproc.c $(@R).combined.c
|
||||
|
||||
..\..\gtk\gtk.gresource.xml: $(GTK_RESOURCES)
|
||||
@echo Generating $@...
|
||||
@echo ^<?xml version='1.0' encoding='UTF-8'?^>> $@
|
||||
@echo ^<gresources^>>> $@
|
||||
@echo ^<gresource prefix='/org/gtk/libgtk'^>>> $@
|
||||
@echo ^<file^>theme/Adwaita/gtk.css^</file^>>> $@
|
||||
@echo ^<file^>theme/Adwaita/gtk-dark.css^</file^>>> $@
|
||||
@echo ^<file^>theme/Adwaita/gtk-contained.css^</file^>>> $@
|
||||
@echo ^<file^>theme/Adwaita/gtk-contained-dark.css^</file^>>> $@
|
||||
@for %%f in (..\..\gtk\theme\Adwaita\assets\*.png) do @echo ^<file preprocess='to-pixdata'^>theme/Adwaita/assets/%%~nxf^</file^>>> $@
|
||||
@for %%f in (..\..\gtk\theme\Adwaita\assets\*.svg) do @echo ^<file^>theme/Adwaita/assets/%%~nxf^</file^>>> $@
|
||||
@echo ^<file^>theme/HighContrast/gtk.css^</file^>>> $@
|
||||
@echo ^<file alias='theme/HighContrastInverse/gtk.css'^>theme/HighContrast/gtk-inverse.css^</file^>>> $@
|
||||
@echo ^<file^>theme/HighContrast/gtk-contained.css^</file^>>> $@
|
||||
@echo ^<file^>theme/HighContrast/gtk-contained-inverse.css^</file^>>> $@
|
||||
@for %%f in (..\..\gtk\theme\HighContrast\assets\*.png) do @echo ^<file preprocess='to-pixdata'^>theme/HighContrast/assets/%%~nxf^</file^>>> $@
|
||||
@for %%f in (..\..\gtk\theme\HighContrast\assets\*.svg) do @echo ^<file^>theme/HighContrast/assets/%%~nxf^</file^>>> $@
|
||||
@echo ^<file^>theme/win32/gtk-win32-base.css^</file^>>> $@
|
||||
@echo ^<file^>theme/win32/gtk.css^</file^>>> $@
|
||||
@for %%f in (..\..\gtk\cursor\*.png) do @echo ^<file^>cursor/%%~nxf^</file^>>> $@
|
||||
@for %%f in (..\..\gtk\gesture\*.symbolic.png) do @echo ^<file alias='icons/64x64/actions/%%~nxf'^>gesture/%%~nxf^</file^>>> $@
|
||||
@for %%f in (..\..\gtk\ui\*.ui) do @echo ^<file preprocess='xml-stripblanks'^>ui/%%~nxf^</file^>>> $@
|
||||
@for %%s in (16 22 24 32 48) do @(for %%c in (actions status categories) do @(for %%f in (..\..\gtk\icons\%%sx%%s\%%c\*.png) do @echo ^<file^>icons/%%sx%%s/%%c/%%~nxf^</file^>>> $@))
|
||||
@for %%s in (scalable) do @(for %%c in (status) do @(for %%f in (..\..\gtk\icons\%%s\%%c\*.svg) do @echo ^<file^>icons/%%s/%%c/%%~nxf^</file^>>> $@))
|
||||
@for %%f in (..\..\gtk\inspector\*.ui) do @echo ^<file compressed='true' preprocess='xml-stripblanks'^>inspector/%%~nxf^</file^>>> $@
|
||||
@echo ^<file^>inspector/logo.png^</file^>>> $@
|
||||
@echo ^<file^>emoji/emoji.data^</file^>>> $@
|
||||
@echo ^</gresource^>>> $@
|
||||
@echo ^</gresources^>>> $@
|
||||
|
||||
..\..\gtk\gtkresources.h: ..\..\gtk\gtk.gresource.xml
|
||||
@echo Generating $@...
|
||||
@if not "$(XMLLINT)" == "" set XMLLINT=$(XMLLINT)
|
||||
@if not "$(JSON_GLIB_FORMAT)" == "" set JSON_GLIB_FORMAT=$(JSON_GLIB_FORMAT)
|
||||
@if not "$(GDK_PIXBUF_PIXDATA)" == "" set GDK_PIXBUF_PIXDATA=$(GDK_PIXBUF_PIXDATA)
|
||||
@$(GLIB_COMPILE_RESOURCES) $(GTK_RESOURCES_ARGS) --generate-header
|
||||
|
||||
..\..\gtk\gtkresources.c: ..\..\gtk\gtk.gresource.xml $(GTK_RESOURCES)
|
||||
@echo Generating $@...
|
||||
@if not "$(XMLLINT)" == "" set XMLLINT=$(XMLLINT)
|
||||
@if not "$(JSON_GLIB_FORMAT)" == "" set JSON_GLIB_FORMAT=$(JSON_GLIB_FORMAT)
|
||||
@if not "$(GDK_PIXBUF_PIXDATA)" == "" set GDK_PIXBUF_PIXDATA=$(GDK_PIXBUF_PIXDATA)
|
||||
@$(GLIB_COMPILE_RESOURCES) $(GTK_RESOURCES_ARGS) --generate-source
|
||||
|
||||
..\..\gtk\gtkmarshalers.h: ..\..\gtk\gtkmarshalers.list
|
||||
@echo Generating $@...
|
||||
@$(PYTHON) $(GLIB_GENMARSHAL) $(GTK_MARSHALERS_FLAGS) --header $** > $@.tmp
|
||||
@move $@.tmp $@
|
||||
|
||||
..\..\gtk\gtkmarshalers.c: ..\..\gtk\gtkmarshalers.list
|
||||
@echo Generating $@...
|
||||
@echo #undef G_ENABLE_DEBUG> $@.tmp
|
||||
@$(PYTHON) $(GLIB_GENMARSHAL) $(GTK_MARSHALERS_FLAGS) --body $** >> $@.tmp
|
||||
@move $@.tmp $@
|
||||
|
||||
..\..\demos\gtk-demo\demo_resources.c: ..\..\demos\gtk-demo\demo.gresource.xml $(GTK_DEMO_RESOURCES)
|
||||
@echo Generating $@...
|
||||
@$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(@D) --generate-source $(@D)\demo.gresource.xml
|
||||
|
||||
..\..\demos\icon-browser\resources.c: ..\..\demos\icon-browser\iconbrowser.gresource.xml $(ICON_BROWSER_RESOURCES)
|
||||
@echo Generating $@...
|
||||
@$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(@D) --generate-source $(@D)\iconbrowser.gresource.xml
|
||||
|
||||
# Remove the generated files
|
||||
clean:
|
||||
@-del /f /q ..\..\demos\icon-browser\resources.c
|
||||
@-del /f /q ..\..\demos\gtk-demo\demo_resources.c
|
||||
@-del /f /q ..\..\demos\gtk-demo\demos.h
|
||||
@-del /f /q ..\..\gtk\gtkresources.c
|
||||
@-del /f /q ..\..\gtk\gtkresources.h
|
||||
@-del /f /q ..\..\gtk\gtkmarshalers.c
|
||||
@-del /f /q ..\..\gtk\gtkmarshalers.h
|
||||
@-del /f /q ..\..\gtk\gtk.gresource.xml
|
||||
@-del /f /q ..\..\gtk\gtktypefuncs.inc
|
||||
@-del /f /q ..\..\gtk\gtkdbusgenerated.c
|
||||
@-del /f /q ..\..\gtk\gtkdbusgenerated.h
|
||||
@-del /f /q ..\..\gtk\libgtk3.manifest
|
||||
@-del /f /q ..\..\gtk\gtk-win32.rc
|
||||
@-del /f /q ..\..\gdk\gdkresources.c
|
||||
@-del /f /q ..\..\gdk\gdkresources.h
|
||||
@-del /f /q ..\..\gdk\gdk.gresource.xml
|
||||
@-del /f /q ..\..\gdk\gdkmarshalers.c
|
||||
@-del /f /q ..\..\gdk\gdkmarshalers.h
|
||||
@-del /f /q ..\..\gdk\gdkversionmacros.h
|
||||
@-del /f /q ..\..\gdk\gdkconfig.h
|
||||
@if exist ..\..\gdk-$(CFG)-$(GDK_CONFIG)-build del ..\..\gdk-$(CFG)-$(GDK_CONFIG)-build
|
||||
@if exist ..\..\gdk-$(GDK_OLD_CFG)-$(GDK_DEL_CONFIG)-build del ..\..\gdk-$(GDK_OLD_CFG)-$(GDK_DEL_CONFIG)-build
|
||||
@if exist ..\..\gdk-$(GDK_OLD_CFG)-$(GDK_CONFIG)-build del ..\..\gdk-$(GDK_OLD_CFG)-$(GDK_CONFIG)-build
|
||||
@if exist ..\..\gdk-$(CFG)-$(GDK_DEL_CONFIG)-build del ..\..\gdk-$(CFG)-$(GDK_DEL_CONFIG)-build
|
||||
@-del /f /q ..\..\config.h
|
||||
@@ -1,41 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="..\..\..\gtk\gtk-win32.rc"><Filter>Resource Files</Filter></ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
#include "gtk-3.vs10.sourcefiles.filters"
|
||||
<ClCompile Include="..\..\..\modules\input\gtkimcontextime.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\modules\input\gtkimcontextmultipress.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\modules\input\gtkimcontextthai.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\modules\input\imam-et.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\modules\input\imcedilla.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\modules\input\imcyrillic-translit.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\modules\input\imime.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\modules\input\iminuktitut.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\modules\input\imipa.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\modules\input\immultipress.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\modules\input\imthai.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\modules\input\imti-er.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\modules\input\imti-et.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\modules\input\imviqr.c"><Filter>Source Files</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\modules\input\thai-charprop.c"><Filter>Source Files</Filter></ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Manifest Include="..\..\..\gtk\libgtk3.manifest"><Filter>Resource Files</Filter></Manifest>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,200 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import re
|
||||
import sys
|
||||
|
||||
try:
|
||||
configure_ac = sys.argv[1]
|
||||
except Exception:
|
||||
configure_ac = 'configure.ac'
|
||||
|
||||
try:
|
||||
meson_build = sys.argv[2]
|
||||
except Exception:
|
||||
meson_build = 'meson.build'
|
||||
|
||||
CONFIGURE_MAJOR_VERSION_RE = re.compile(
|
||||
r'''
|
||||
^
|
||||
\s*
|
||||
m4_define\(
|
||||
\s*
|
||||
\[gtk_major_version\]
|
||||
\s*
|
||||
,
|
||||
\s*
|
||||
\[
|
||||
(?P<version>[0-9]+)
|
||||
\]
|
||||
\s*
|
||||
\)
|
||||
$
|
||||
''',
|
||||
re.UNICODE | re.VERBOSE
|
||||
)
|
||||
|
||||
CONFIGURE_MINOR_VERSION_RE = re.compile(
|
||||
r'''
|
||||
^
|
||||
\s*
|
||||
m4_define\(
|
||||
\s*
|
||||
\[gtk_minor_version\]
|
||||
\s*
|
||||
,
|
||||
\s*
|
||||
\[
|
||||
(?P<version>[0-9]+)
|
||||
\]
|
||||
\s*
|
||||
\)
|
||||
$
|
||||
''',
|
||||
re.UNICODE | re.VERBOSE
|
||||
)
|
||||
|
||||
CONFIGURE_MICRO_VERSION_RE = re.compile(
|
||||
r'''
|
||||
^
|
||||
\s*
|
||||
m4_define\(
|
||||
\s*
|
||||
\[gtk_micro_version\]
|
||||
\s*
|
||||
,
|
||||
\s*
|
||||
\[
|
||||
(?P<version>[0-9]+)
|
||||
\]
|
||||
\s*
|
||||
\)
|
||||
$
|
||||
''',
|
||||
re.UNICODE | re.VERBOSE
|
||||
)
|
||||
|
||||
CONFIGURE_INTERFACE_AGE_RE = re.compile(
|
||||
r'''
|
||||
^
|
||||
\s*
|
||||
m4_define\(
|
||||
\s*
|
||||
\[gtk_interface_age\]
|
||||
\s*
|
||||
,
|
||||
\s*
|
||||
\[
|
||||
(?P<age>[0-9]+)
|
||||
\]
|
||||
\s*
|
||||
\)
|
||||
$
|
||||
''',
|
||||
re.UNICODE | re.VERBOSE
|
||||
)
|
||||
|
||||
MESON_VERSION_RE = re.compile(
|
||||
r'''
|
||||
^
|
||||
\s*
|
||||
version
|
||||
\s*
|
||||
:{1}
|
||||
\s*
|
||||
\'{1}
|
||||
(?P<major>[0-9]+)
|
||||
\.{1}
|
||||
(?P<minor>[0-9]+)
|
||||
\.{1}
|
||||
(?P<micro>[0-9]+)
|
||||
\'{1}
|
||||
\s*
|
||||
,?
|
||||
$
|
||||
''',
|
||||
re.UNICODE | re.VERBOSE
|
||||
)
|
||||
|
||||
MESON_INTERFACE_AGE_RE = re.compile(
|
||||
r'''
|
||||
^\s*gtk_interface_age\s*={1}\s*(?P<age>[0-9]+)\s*$
|
||||
''',
|
||||
re.UNICODE | re.VERBOSE
|
||||
)
|
||||
|
||||
version = {}
|
||||
|
||||
with open(configure_ac, 'r') as f:
|
||||
line = f.readline()
|
||||
while line:
|
||||
res = CONFIGURE_MAJOR_VERSION_RE.match(line)
|
||||
if res:
|
||||
if 'major' in version:
|
||||
print(f'Redefinition of major version; version is already set to {version["major"]}')
|
||||
sys.exit(1)
|
||||
version['major'] = res.group('version')
|
||||
line = f.readline()
|
||||
continue
|
||||
res = CONFIGURE_MINOR_VERSION_RE.match(line)
|
||||
if res:
|
||||
if 'minor' in version:
|
||||
print(f'Redefinition of minor version; version is already set to {version["minor"]}')
|
||||
sys.exit(1)
|
||||
version['minor'] = res.group('version')
|
||||
line = f.readline()
|
||||
continue
|
||||
res = CONFIGURE_MICRO_VERSION_RE.match(line)
|
||||
if res:
|
||||
if 'micro' in version:
|
||||
print(f'Redefinition of micro version; version is already set to {version["micro"]}')
|
||||
sys.exit(1)
|
||||
version['micro'] = res.group('version')
|
||||
line = f.readline()
|
||||
continue
|
||||
res = CONFIGURE_INTERFACE_AGE_RE.match(line)
|
||||
if res:
|
||||
if 'age' in version:
|
||||
print(f'Redefinition of interface age; age is already set to {version["age"]}')
|
||||
sys.exit(1)
|
||||
version['age'] = res.group('age')
|
||||
line = f.readline()
|
||||
continue
|
||||
if ('major', 'minor', 'micro', 'age') in version:
|
||||
break
|
||||
line = f.readline()
|
||||
|
||||
print(f'GTK version defined in {configure_ac}: {version["major"]}.{version["minor"]}.{version["micro"]} (age: {version["age"]})')
|
||||
|
||||
configure_version = version
|
||||
version = {}
|
||||
|
||||
with open(meson_build, 'r') as f:
|
||||
line = f.readline()
|
||||
inside_project = False
|
||||
while line:
|
||||
if line.startswith('project('):
|
||||
inside_project = True
|
||||
if inside_project:
|
||||
res = MESON_VERSION_RE.match(line)
|
||||
if res:
|
||||
version['major'] = res.group('major')
|
||||
version['minor'] = res.group('minor')
|
||||
version['micro'] = res.group('micro')
|
||||
if inside_project and line.endswith(')'):
|
||||
inside_project = False
|
||||
res = MESON_INTERFACE_AGE_RE.match(line)
|
||||
if res:
|
||||
version['age'] = res.group('age')
|
||||
if ('major', 'minor', 'micro', 'age') in version:
|
||||
break
|
||||
line = f.readline()
|
||||
|
||||
print(f'GTK version defined in {meson_build}: {version["major"]}.{version["minor"]}.{version["micro"]} (age: {version["age"]})')
|
||||
|
||||
meson_version = version
|
||||
|
||||
if configure_version != meson_version:
|
||||
print('Version mismatch between Autotools and Meson builds')
|
||||
sys.exit(1)
|
||||
|
||||
sys.exit(0)
|
||||
@@ -44,6 +44,9 @@
|
||||
/* Define to 1 if you have the `flockfile' function. */
|
||||
#mesondefine HAVE_FLOCKFILE
|
||||
|
||||
/* Define to 1 if you have the `fmin' function. */
|
||||
#mesondefine HAVE_FMIN
|
||||
|
||||
/* Define to 1 if you have the <ftw.h> header file. */
|
||||
#mesondefine HAVE_FTW_H
|
||||
|
||||
@@ -281,3 +284,6 @@
|
||||
#mesondefine GTK_LOCALEDIR
|
||||
|
||||
#mesondefine ISO_CODES_PREFIX
|
||||
|
||||
/* Define if tracker3 is available */
|
||||
#mesondefine HAVE_TRACKER3
|
||||
@@ -52,6 +52,11 @@
|
||||
/* Define to 1 if you have the `flockfile' function. */
|
||||
#undef HAVE_FLOCKFILE
|
||||
|
||||
/* Define to 1 if you have the `fmin' function. */
|
||||
#if !defined (_MSC_VER) || (_MSC_VER >= 1800)
|
||||
# define HAVE_FMIN 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the <ftw.h> header file. */
|
||||
/* #undef HAVE_FTW_H */
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [24])
|
||||
m4_define([gtk_micro_version], [17])
|
||||
m4_define([gtk_interface_age], [13])
|
||||
m4_define([gtk_micro_version], [26])
|
||||
m4_define([gtk_interface_age], [22])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
m4_define([gtk_version],
|
||||
@@ -56,12 +56,12 @@ GLIB_VERSION_CFLAGS="-DGLIB_MIN_REQUIRED_VERSION=glib_min_required_version -DGLI
|
||||
|
||||
m4_define([pango_required_version], [1.41.0])
|
||||
m4_define([fribidi_required_version], [0.19.7])
|
||||
m4_define([atk_required_version], [2.15.1])
|
||||
m4_define([atk_required_version], [2.32.0])
|
||||
m4_define([cairo_required_version], [1.14.0])
|
||||
m4_define([gdk_pixbuf_required_version], [2.30.0])
|
||||
m4_define([introspection_required_version], [1.39.0])
|
||||
m4_define([wayland_required_version], [1.14.91])
|
||||
m4_define([wayland_protocols_required_version], [1.14])
|
||||
m4_define([wayland_protocols_required_version], [1.17])
|
||||
m4_define([epoxy_required_version], [1.4])
|
||||
m4_define([cloudproviders_required_version], [0.2.5])
|
||||
m4_define([sysprof_required_version], [3.33.2])
|
||||
@@ -843,7 +843,7 @@ AC_TYPE_UID_T
|
||||
# Check for round(), rint(), isnan() and isinf()
|
||||
# Check for log2(), exp2(), nearbyint() and trunc()
|
||||
AC_CHECK_LIB(m,round,,)
|
||||
AC_CHECK_FUNCS(round rint nearbyint sincos exp2 log2 trunc)
|
||||
AC_CHECK_FUNCS(round rint nearbyint sincos exp2 log2 trunc fmin)
|
||||
AC_CHECK_DECLS([isnan, isinf], [], [], [[#include <math.h>]])
|
||||
|
||||
AC_MSG_CHECKING(whether to build dynamic modules)
|
||||
@@ -1552,6 +1552,30 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
# Checks to see if we should compile with tracker3 search engine
|
||||
#
|
||||
|
||||
AC_ARG_ENABLE(tracker3,
|
||||
[AS_HELP_STRING([--enable-tracker3],
|
||||
[enable tracker3 search engine])],
|
||||
[enable_tracker3=yes],
|
||||
[enable_tracker3=no])
|
||||
|
||||
if test "x$enable_tracker3" = "xyes"; then
|
||||
PKG_CHECK_MODULES(TRACKER3, [tracker-sparql-3.0], have_tracker3=yes, have_tracker3=no)
|
||||
GTK_DEP_CFLAGS="$GTK_DEP_CFLAGS $TRACKER3_CFLAGS"
|
||||
GTK_DEP_LIBS="$GTK_DEP_LIBS $TRACKER3_LIBS"
|
||||
if test "x$have_tracker3" = "xyes"; then
|
||||
AC_DEFINE([HAVE_TRACKER3], [], [Define if tracker3 is available])
|
||||
else
|
||||
AC_MSG_ERROR([
|
||||
*** tracker3 not found.
|
||||
])
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(HAVE_TRACKER3, test "x$have_tracker3" = "xyes")
|
||||
|
||||
# Checks to see if we should compile with cloudprint backend for GTK+
|
||||
#
|
||||
|
||||
@@ -1940,18 +1964,17 @@ docs/reference/gtk/getting_started.xml
|
||||
docs/reference/libgail-util/Makefile
|
||||
docs/reference/libgail-util/version.xml
|
||||
docs/tools/Makefile
|
||||
build/Makefile
|
||||
build/win32/Makefile
|
||||
build/win32/config-msvc.mak
|
||||
build/win32/vs9/Makefile
|
||||
build/win32/vs9/gtk3-version-paths.vsprops
|
||||
build/win32/vs10/Makefile
|
||||
build/win32/vs10/gtk3-version-paths.props
|
||||
build/win32/vs11/Makefile
|
||||
build/win32/vs12/Makefile
|
||||
build/win32/vs14/Makefile
|
||||
build/win32/vs15/Makefile
|
||||
build/win32/vs16/Makefile
|
||||
win32/Makefile
|
||||
win32/config-msvc.mak
|
||||
win32/vs9/Makefile
|
||||
win32/vs9/gtk3-version-paths.vsprops
|
||||
win32/vs10/Makefile
|
||||
win32/vs10/gtk3-version-paths.props
|
||||
win32/vs11/Makefile
|
||||
win32/vs12/Makefile
|
||||
win32/vs14/Makefile
|
||||
win32/vs15/Makefile
|
||||
win32/vs16/Makefile
|
||||
gdk/Makefile
|
||||
gdk/broadway/Makefile
|
||||
gdk/x11/Makefile
|
||||
|
||||
@@ -116,6 +116,7 @@ EXTRA_DIST += \
|
||||
data/symbolic-source.svg \
|
||||
demo.gresource.xml \
|
||||
$(resource_files) \
|
||||
makefile.msc.in \
|
||||
org.gtk.Demo.gschema.xml \
|
||||
demos.h.win32 \
|
||||
meson.build \
|
||||
@@ -195,11 +196,11 @@ gtk3_demo_EXCLUDES = font_features.c|pagesetup.c
|
||||
gtk3_demo_application_FILES = $(gtk3_demo_application_SOURCES)
|
||||
gtk3_demo_application_EXCLUDES = dummy
|
||||
|
||||
include $(top_srcdir)/build/Makefile.msvcproj
|
||||
include $(top_srcdir)/win32/Makefile.msvcproj
|
||||
|
||||
dist-hook: \
|
||||
$(top_builddir)/build/win32/vs9/gtk3-demo.vcproj \
|
||||
$(top_builddir)/build/win32/vs9/gtk3-demo-application.vcproj
|
||||
$(top_builddir)/win32/vs9/gtk3-demo.vcproj \
|
||||
$(top_builddir)/win32/vs9/gtk3-demo-application.vcproj
|
||||
|
||||
DISTCLEANFILES = demos.h demos.h.win32
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@ MSVCPROJS = gtk3-icon-browser
|
||||
gtk3_icon_browser_FILES = $(gtk3_icon_browser_SOURCES)
|
||||
gtk3_icon_browser_EXCLUDES = dummy
|
||||
|
||||
include $(top_srcdir)/build/Makefile.msvcproj
|
||||
include $(top_srcdir)/win32/Makefile.msvcproj
|
||||
|
||||
dist-hook: $(top_builddir)/build/win32/vs9/gtk3-icon-browser.vcproj
|
||||
dist-hook: $(top_builddir)/win32/vs9/gtk3-icon-browser.vcproj
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
||||
@@ -1655,6 +1655,66 @@ adjustment3_value_changed (GtkAdjustment *adj, GtkProgressBar *pbar)
|
||||
gtk_progress_bar_set_fraction (pbar, fraction);
|
||||
}
|
||||
|
||||
static void
|
||||
validate_more_details (GtkEntry *entry,
|
||||
GParamSpec *pspec,
|
||||
GtkEntry *details)
|
||||
{
|
||||
if (strlen (gtk_entry_get_text (entry)) > 0 &&
|
||||
strlen (gtk_entry_get_text (details)) == 0)
|
||||
{
|
||||
gtk_widget_set_tooltip_text (GTK_WIDGET (entry), "Must have details first");
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (entry)), "error");
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_set_tooltip_text (GTK_WIDGET (entry), "");
|
||||
gtk_style_context_remove_class (gtk_widget_get_style_context (GTK_WIDGET (entry)), "error");
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
mode_switch_state_set (GtkSwitch *sw, gboolean state)
|
||||
{
|
||||
GtkWidget *dialog = gtk_widget_get_ancestor (GTK_WIDGET (sw), GTK_TYPE_DIALOG);
|
||||
GtkWidget *scale = GTK_WIDGET (g_object_get_data (G_OBJECT (dialog), "level_scale"));
|
||||
GtkWidget *label = GTK_WIDGET (g_object_get_data (G_OBJECT (dialog), "error_label"));
|
||||
|
||||
if (!state ||
|
||||
(gtk_range_get_value (GTK_RANGE (scale)) > 50))
|
||||
{
|
||||
gtk_widget_hide (label);
|
||||
gtk_switch_set_state (sw, state);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_show (label);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
level_scale_value_changed (GtkRange *range)
|
||||
{
|
||||
GtkWidget *dialog = gtk_widget_get_ancestor (GTK_WIDGET (range), GTK_TYPE_DIALOG);
|
||||
GtkWidget *sw = GTK_WIDGET (g_object_get_data (G_OBJECT (dialog), "mode_switch"));
|
||||
GtkWidget *label = GTK_WIDGET (g_object_get_data (G_OBJECT (dialog), "error_label"));
|
||||
|
||||
if (gtk_switch_get_active (GTK_SWITCH (sw)) &&
|
||||
!gtk_switch_get_state (GTK_SWITCH (sw)) &&
|
||||
(gtk_range_get_value (range) > 50))
|
||||
{
|
||||
gtk_widget_hide (label);
|
||||
gtk_switch_set_state (GTK_SWITCH (sw), TRUE);
|
||||
}
|
||||
else if (gtk_switch_get_state (GTK_SWITCH (sw)) &&
|
||||
(gtk_range_get_value (range) <= 50))
|
||||
{
|
||||
gtk_switch_set_state (GTK_SWITCH (sw), FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
activate (GApplication *app)
|
||||
{
|
||||
@@ -1722,6 +1782,9 @@ activate (GApplication *app)
|
||||
gtk_builder_add_callback_symbol (builder, "reset_icon_size", (GCallback)reset_icon_size);
|
||||
gtk_builder_add_callback_symbol (builder, "scale_format_value", (GCallback)scale_format_value);
|
||||
gtk_builder_add_callback_symbol (builder, "scale_format_value_blank", (GCallback)scale_format_value_blank);
|
||||
gtk_builder_add_callback_symbol (builder, "validate_more_details", (GCallback)validate_more_details);
|
||||
gtk_builder_add_callback_symbol (builder, "mode_switch_state_set", (GCallback)mode_switch_state_set);
|
||||
gtk_builder_add_callback_symbol (builder, "level_scale_value_changed", (GCallback)level_scale_value_changed);
|
||||
|
||||
gtk_builder_connect_signals (builder, NULL);
|
||||
|
||||
@@ -1820,6 +1883,13 @@ activate (GApplication *app)
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "circular_button");
|
||||
g_signal_connect (widget, "clicked", G_CALLBACK (show_dialog), dialog);
|
||||
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "level_scale");
|
||||
g_object_set_data (G_OBJECT (dialog), "level_scale", widget);
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "mode_switch");
|
||||
g_object_set_data (G_OBJECT (dialog), "mode_switch", widget);
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "error_label");
|
||||
g_object_set_data (G_OBJECT (dialog), "error_label", widget);
|
||||
|
||||
dialog = (GtkWidget *)gtk_builder_get_object (builder, "selection_dialog");
|
||||
g_object_set_data (G_OBJECT (window), "selection_dialog", dialog);
|
||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "text3");
|
||||
|
||||
@@ -3989,6 +3989,7 @@ bad things might happen.</property>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -4012,10 +4013,12 @@ bad things might happen.</property>
|
||||
<object class="GtkEntry" id="more_details_entry">
|
||||
<property name="visible">1</property>
|
||||
<property name="valign">baseline</property>
|
||||
<signal name="notify::text" handler="validate_more_details" object="details_entry" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -4041,10 +4044,12 @@ bad things might happen.</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="draw-value">0</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
<signal name="value-changed" handler="level_scale_value_changed"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">2</property>
|
||||
<property name="width">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@@ -4069,12 +4074,28 @@ bad things might happen.</property>
|
||||
<property name="visible">1</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">baseline</property>
|
||||
<signal name="state-set" handler="mode_switch_state_set"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="error_label">
|
||||
<property name="visible">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">Level too low</property>
|
||||
<style>
|
||||
<class name="error"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">2</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
@@ -8,6 +8,7 @@ EXTRA_DIST += \
|
||||
developers.txt \
|
||||
dnd_internals.txt \
|
||||
focus_tracking.txt \
|
||||
iconcache.txt \
|
||||
RELEASE-HOWTO \
|
||||
sizing-test.txt \
|
||||
styles.txt \
|
||||
|
||||
@@ -1279,6 +1279,8 @@ GdkWaylandWindowExported
|
||||
gdk_wayland_window_export_handle
|
||||
gdk_wayland_window_unexport_handle
|
||||
gdk_wayland_window_set_transient_for_exported
|
||||
gdk_wayland_window_add_frame_callback_surface
|
||||
gdk_wayland_window_remove_frame_callback_surface
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GDK_TYPE_WAYLAND_DEVICE
|
||||
|
||||
@@ -385,6 +385,7 @@ HTML_IMAGES = \
|
||||
$(srcdir)/images/pagesetupdialog.png \
|
||||
$(srcdir)/images/placessidebar.png \
|
||||
$(srcdir)/images/popup-anchors.png \
|
||||
$(srcdir)/images/popup-at.svg \
|
||||
$(srcdir)/images/popup-flip.png \
|
||||
$(srcdir)/images/popup-slide.png \
|
||||
$(srcdir)/images/printdialog.png \
|
||||
|
||||
@@ -36,7 +36,7 @@ How do I get started with GTK+?
|
||||
|
||||
<answer><para>
|
||||
The GTK+ <ulink url="https://www.gtk.org">website</ulink> offers some
|
||||
<ulink url="https://www.gtk.org/documentation.php">tutorials</ulink> and other
|
||||
<ulink url="https://www.gtk.org/docs/">tutorials</ulink> and other
|
||||
documentation (most of it about GTK+ 2.x, but mostly still applicable).
|
||||
More documentation ranging from whitepapers to online books can be found at
|
||||
the <ulink url="https://developer.gnome.org">GNOME developer's site</ulink>.
|
||||
@@ -77,7 +77,7 @@ specific widgets and functions.
|
||||
<para>
|
||||
If you have a question not covered in the manual, feel free to
|
||||
ask on the mailing lists and please <ulink
|
||||
url="https://bugzilla.gnome.org">file a bug report</ulink> against the
|
||||
url="https://gitlab.gnome.org/GNOME/gtk/issues/new">file a bug report</ulink> against the
|
||||
documentation.
|
||||
</para>
|
||||
|
||||
@@ -105,8 +105,8 @@ state (explained in its documentation).
|
||||
For strings returned from functions, they will be declared "const"
|
||||
if they should not be freed. Non-const strings should be
|
||||
freed with g_free(). Arrays follow the same rule. If you find an
|
||||
undocumented exception to the rules, please report a bug to <ulink
|
||||
url="https://bugzilla.gnome.org">https://bugzilla.gnome.org</ulink>.
|
||||
undocumented exception to the rules, please report a bug on <ulink
|
||||
url="https://gitlab.gnome.org/GNOME/gtk/issues/new">GitLab</ulink>.
|
||||
</para>
|
||||
|
||||
</answer>
|
||||
@@ -415,7 +415,7 @@ How do I use GTK+ with other non-C languages?
|
||||
|
||||
<answer>
|
||||
<para>
|
||||
See the <ulink url="https://www.gtk.org/language-bindings.php">list of language
|
||||
See the <ulink url="https://www.gtk.org/docs/language-bindings/">list of language
|
||||
bindings</ulink> on <ulink
|
||||
url="https://www.gtk.org">https://www.gtk.org</ulink>.
|
||||
</para>
|
||||
|
||||
@@ -134,9 +134,9 @@ additional environment variables.
|
||||
<title><envar>GTK_DEBUG</envar></title>
|
||||
|
||||
<para>
|
||||
Unless GTK+ has been configured with <option>--enable-debug=no</option>,
|
||||
this variable can be set to a list of debug options, which cause GTK+
|
||||
to print out different types of debugging information.
|
||||
This variable can be set to a list of debug options, which cause GTK to
|
||||
print out different types of debugging information. Some of these options
|
||||
are only available when GTK has been configured with <option>--enable-debug=yes</option>.
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>actions</term>
|
||||
|
||||
@@ -18,6 +18,7 @@ exampleapp_SOURCES = \
|
||||
exampleappwin.c exampleappwin.h
|
||||
|
||||
EXTRA_DIST = \
|
||||
exampleapp.desktop \
|
||||
meson.build
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
||||
@@ -471,7 +471,7 @@ stamp-gc-h: $(top_builddir)/config.status
|
||||
# Resources
|
||||
#
|
||||
|
||||
glsl_sources := $(wildcard $(srcdir)/resources/glsl/*.glsl)
|
||||
glsl_sources := $(sort $(wildcard $(srcdir)/resources/glsl/*.glsl))
|
||||
|
||||
gdk.gresource.xml: Makefile.am
|
||||
$(AM_V_GEN) echo "<?xml version='1.0' encoding='UTF-8'?>" > $@; \
|
||||
@@ -491,10 +491,10 @@ resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --gener
|
||||
|
||||
gdkresources.h: gdk.gresource.xml
|
||||
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ \
|
||||
--sourcedir=$(srcdir) --c-name _gdk --generate-header --manual-register
|
||||
--sourcedir=$(srcdir) --c-name _gdk --generate-header --manual-register --internal
|
||||
gdkresources.c: gdk.gresource.xml $(resource_files)
|
||||
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< --target=$@ \
|
||||
--sourcedir=$(srcdir) --c-name _gdk --generate-source --manual-register
|
||||
--sourcedir=$(srcdir) --c-name _gdk --generate-source --manual-register --internal
|
||||
|
||||
# ------------------- MSVC Build Items ----------------
|
||||
MSVCPROJS = gdk-3
|
||||
@@ -510,7 +510,7 @@ gdk_3_HEADERS_INST = \
|
||||
|
||||
gdk_3_HEADERS_EXCLUDES = dummy
|
||||
|
||||
include $(top_srcdir)/build/Makefile.msvcproj
|
||||
include $(top_srcdir)/win32/Makefile.msvcproj
|
||||
|
||||
if HAVE_INTROSPECTION
|
||||
# Introspection Items for MSVC
|
||||
@@ -518,13 +518,13 @@ MSVC_INTROSPECT_GIRS = Gdk-3.0.gir GdkWin32-3.0.gir
|
||||
|
||||
BASE_MSVC_GIR_CFLAGS = \
|
||||
$(GDK_CFLAGS_DEFINES) \
|
||||
-I../.. -I../../gdk -I.../../gdk/win32
|
||||
-I.. -I../gdk -I../gdk/win32
|
||||
|
||||
INTROSPECTION_INTERMEDIATE_ITEMS = \
|
||||
$(top_builddir)/build/win32/Gdk-3.0.gir.msvc.introspect \
|
||||
$(top_builddir)/build/win32/Gdk_3_0_gir_list \
|
||||
$(top_builddir)/build/win32/GdkWin32-3.0.gir.msvc.introspect \
|
||||
$(top_builddir)/build/win32/GdkWin32_3_0_gir_list
|
||||
$(top_builddir)/win32/Gdk-3.0.gir.msvc.introspect \
|
||||
$(top_builddir)/win32/Gdk_3_0_gir_list \
|
||||
$(top_builddir)/win32/GdkWin32-3.0.gir.msvc.introspect \
|
||||
$(top_builddir)/win32/GdkWin32_3_0_gir_list
|
||||
|
||||
Gdk_3_0_gir_MSVC_FILES = $(introspection_files)
|
||||
Gdk_3_0_gir_MSVC_EXPORT_PACKAGES = $(Gdk_3_0_gir_EXPORT_PACKAGES)
|
||||
@@ -542,15 +542,15 @@ GdkWin32_3_0_gir_MSVC_SCANNERFLAGS = \
|
||||
--c-include="gdk/gdkwin32.h" \
|
||||
--include-uninstalled='./vs$$$$(VSVER)/$$$$(CFG)/$$$$(PLAT)/bin/Gdk-3.0.gir'
|
||||
|
||||
include $(top_srcdir)/build/Makefile.msvc-introspection
|
||||
include $(top_srcdir)/win32/Makefile.msvc-introspection
|
||||
|
||||
else
|
||||
INTROSPECTION_INTERMEDIATE_ITEMS =
|
||||
endif
|
||||
|
||||
dist-hook: \
|
||||
$(top_builddir)/build/win32/vs9/gdk-3.vcproj \
|
||||
$(top_builddir)/build/win32/vs9/gdk-3.headers \
|
||||
$(top_builddir)/win32/vs9/gdk-3.vcproj \
|
||||
$(top_builddir)/win32/vs9/gdk-3.headers \
|
||||
$(INTROSPECTION_INTERMEDIATE_ITEMS)
|
||||
|
||||
DISTCLEANFILES = gdkconfig.h stamp-gc-h
|
||||
|
||||
@@ -126,11 +126,11 @@ gdk3_broadway_HEADERS_EXCLUDES = dummy
|
||||
broadwayd_FILES = $(broadwayd_SOURCES)
|
||||
broadwayd_EXCLUDES = dummy
|
||||
|
||||
include $(top_srcdir)/build/Makefile.msvcproj
|
||||
include $(top_srcdir)/win32/Makefile.msvcproj
|
||||
|
||||
dist-hook: \
|
||||
$(top_builddir)/build/win32/vs9/gdk3-broadway.vcproj \
|
||||
$(top_builddir)/build/win32/vs9/broadwayd.vcproj \
|
||||
$(top_builddir)/build/win32/vs9/gdk3-broadway.headers
|
||||
$(top_builddir)/win32/vs9/gdk3-broadway.vcproj \
|
||||
$(top_builddir)/win32/vs9/broadwayd.vcproj \
|
||||
$(top_builddir)/win32/vs9/gdk3-broadway.headers
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
||||
@@ -1,3 +1,27 @@
|
||||
/* check if we are on Android and using Chrome */
|
||||
var isAndroidChrome = false;
|
||||
{
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.indexOf("android") > -1 && ua.indexOf("chrom") > -1) {
|
||||
isAndroidChrome = true;
|
||||
}
|
||||
}
|
||||
/* check for the passive option for Event listener */
|
||||
let passiveSupported = false;
|
||||
try {
|
||||
const options = {
|
||||
get passive() { // This function will be called when the browser
|
||||
// attempts to access the passive property.
|
||||
passiveSupported = true;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener("test", null, options);
|
||||
window.removeEventListener("test", null, options);
|
||||
} catch(err) {
|
||||
passiveSupported = false;
|
||||
}
|
||||
/* Helper functions for debugging */
|
||||
var logDiv = null;
|
||||
function log(str) {
|
||||
@@ -10,6 +34,25 @@ function log(str) {
|
||||
logDiv.appendChild(document.createTextNode(str));
|
||||
logDiv.appendChild(document.createElement('br'));
|
||||
}
|
||||
/* Helper functions for touch identifier to make it unique on Android */
|
||||
var globalTouchIdentifier = Math.round(Date.now() / 1000);
|
||||
function touchIdentifierStart(tId)
|
||||
{
|
||||
if (isAndroidChrome) {
|
||||
if (tId == 0) {
|
||||
return ++globalTouchIdentifier;
|
||||
}
|
||||
return globalTouchIdentifier + tId;
|
||||
}
|
||||
return tId;
|
||||
}
|
||||
function touchIdentifier(tId)
|
||||
{
|
||||
if (isAndroidChrome) {
|
||||
return globalTouchIdentifier + tId;
|
||||
}
|
||||
return tId;
|
||||
}
|
||||
|
||||
function getStackTrace()
|
||||
{
|
||||
@@ -91,6 +134,7 @@ grab.window = null;
|
||||
grab.ownerEvents = false;
|
||||
grab.implicit = false;
|
||||
var keyDownList = [];
|
||||
var inputList = [];
|
||||
var lastSerial = 0;
|
||||
var lastX = 0;
|
||||
var lastY = 0;
|
||||
@@ -223,6 +267,7 @@ function cmdSetTransientFor(id, parentId)
|
||||
{
|
||||
var surface = surfaces[id];
|
||||
|
||||
if (surface === undefined) return;
|
||||
if (surface.transientParent == parentId)
|
||||
return;
|
||||
|
||||
@@ -253,8 +298,9 @@ function moveToHelper(surface, position) {
|
||||
|
||||
for (var cid in surfaces) {
|
||||
var child = surfaces[cid];
|
||||
if (child.transientParent == surface.id)
|
||||
if (child.transientParent == surface.id) {
|
||||
moveToHelper(child, stackingOrder.indexOf(surface) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,6 +315,13 @@ function cmdDeleteSurface(id)
|
||||
stackingOrder.splice(i, 1);
|
||||
var canvas = surface.canvas;
|
||||
canvas.parentNode.removeChild(canvas);
|
||||
if (id == windowWithMouse) {
|
||||
windowWithMouse = 0;
|
||||
}
|
||||
if (id == realWindowWithMouse) {
|
||||
realWindowWithMouse = 0;
|
||||
firstTouchDownId = null;
|
||||
}
|
||||
delete surfaces[id];
|
||||
}
|
||||
|
||||
@@ -307,6 +360,7 @@ function cmdRaiseSurface(id)
|
||||
{
|
||||
var surface = surfaces[id];
|
||||
|
||||
if (surface === undefined) return;
|
||||
moveToHelper(surface);
|
||||
restackWindows();
|
||||
}
|
||||
@@ -315,6 +369,7 @@ function cmdLowerSurface(id)
|
||||
{
|
||||
var surface = surfaces[id];
|
||||
|
||||
if (surface === undefined) return;
|
||||
moveToHelper(surface, 0);
|
||||
restackWindows();
|
||||
}
|
||||
@@ -520,6 +575,7 @@ function cmdPutBuffer(id, w, h, compressed)
|
||||
var data = inflate.decompress();
|
||||
|
||||
var imageData = decodeBuffer (context, surface.imageData, w, h, data, debugDecoding);
|
||||
context.imageSmoothingEnabled = false;
|
||||
context.putImageData(imageData, 0, 0);
|
||||
|
||||
if (debugDecoding)
|
||||
@@ -776,8 +832,15 @@ function getEffectiveEventTarget (id) {
|
||||
function updateKeyboardStatus() {
|
||||
if (fakeInput != null && showKeyboardChanged) {
|
||||
showKeyboardChanged = false;
|
||||
if (showKeyboard)
|
||||
if (showKeyboard) {
|
||||
if (isAndroidChrome) {
|
||||
fakeInput.blur();
|
||||
fakeInput.value = ' '.repeat(80); // TODO: Should be exchange with broadway server
|
||||
// to bring real value here.
|
||||
}
|
||||
fakeInput.focus();
|
||||
//if (isAndroidChrome) fakeInput.click();
|
||||
}
|
||||
else
|
||||
fakeInput.blur();
|
||||
}
|
||||
@@ -2329,6 +2392,19 @@ function pushKeyEvent(fev) {
|
||||
keyDownList.push(fev);
|
||||
}
|
||||
|
||||
function copyInputEvent(ev) {
|
||||
var members = ['inputType', 'data'], i, obj = {};
|
||||
for (i = 0; i < members.length; i++) {
|
||||
if (typeof ev[members[i]] !== "undefined")
|
||||
obj[members[i]] = ev[members[i]];
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
function pushInputEvent(fev) {
|
||||
inputList.push(fev);
|
||||
}
|
||||
|
||||
function getKeyEvent(keyCode, pop) {
|
||||
var i, fev = null;
|
||||
for (i = keyDownList.length-1; i >= 0; i--) {
|
||||
@@ -2366,8 +2442,9 @@ function handleKeyDown(e) {
|
||||
// If it is a key or key combination that might trigger
|
||||
// browser behaviors or it has no corresponding keyPress
|
||||
// event, then send it immediately
|
||||
if (!ignoreKeyEvent(ev))
|
||||
if (!ignoreKeyEvent(ev)) {
|
||||
sendInput("k", [keysym, lastState]);
|
||||
}
|
||||
suppress = true;
|
||||
}
|
||||
|
||||
@@ -2411,8 +2488,9 @@ function handleKeyPress(e) {
|
||||
}
|
||||
|
||||
// Send the translated keysym
|
||||
if (keysym > 0)
|
||||
if (keysym > 0) {
|
||||
sendInput ("k", [keysym, lastState]);
|
||||
}
|
||||
|
||||
// Stop keypress events just in case
|
||||
return cancelEvent(ev);
|
||||
@@ -2427,11 +2505,45 @@ function handleKeyUp(e) {
|
||||
keysym = fev.keysym;
|
||||
else {
|
||||
//log("Key event (keyCode = " + ev.keyCode + ") not found on keyDownList");
|
||||
if (isAndroidChrome && (ev.keyCode == 229)) {
|
||||
var i, fev = null, len = inputList.length, str;
|
||||
for (i = 0; i < len; i++) {
|
||||
fev = inputList[i];
|
||||
switch(fev.inputType) {
|
||||
case "deleteContentBackward":
|
||||
sendInput ("k", [65288, lastState]);
|
||||
sendInput ("K", [65288, lastState]);
|
||||
break;
|
||||
case "insertText":
|
||||
if (fev.data !== undefined) {
|
||||
for (let sym of fev.data) {
|
||||
sendInput ("k", [sym.codePointAt(0), lastState]);
|
||||
sendInput ("K", [sym.codePointAt(0), lastState]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
inputList.splice(0, len);
|
||||
}
|
||||
keysym = 0;
|
||||
}
|
||||
|
||||
if (keysym > 0)
|
||||
if (keysym > 0) {
|
||||
sendInput ("K", [keysym, lastState]);
|
||||
}
|
||||
return cancelEvent(ev);
|
||||
}
|
||||
|
||||
function handleInput (e) {
|
||||
var fev = null, ev = (e ? e : window.event), keysym = null, suppress = false;
|
||||
|
||||
fev = copyInputEvent(ev);
|
||||
pushInputEvent(fev);
|
||||
|
||||
// Stop keypress events just in case
|
||||
return cancelEvent(ev);
|
||||
}
|
||||
|
||||
@@ -2450,6 +2562,11 @@ function onKeyUp (ev) {
|
||||
return handleKeyUp(ev);
|
||||
}
|
||||
|
||||
function onInput (ev) {
|
||||
updateForEvent(ev);
|
||||
return handleInput(ev);
|
||||
}
|
||||
|
||||
function cancelEvent(ev)
|
||||
{
|
||||
ev = ev ? ev : window.event;
|
||||
@@ -2481,13 +2598,14 @@ function onMouseWheel(ev)
|
||||
}
|
||||
|
||||
function onTouchStart(ev) {
|
||||
event.preventDefault();
|
||||
ev.preventDefault();
|
||||
|
||||
updateKeyboardStatus();
|
||||
updateForEvent(ev);
|
||||
|
||||
for (var i = 0; i < ev.changedTouches.length; i++) {
|
||||
var touch = ev.changedTouches.item(i);
|
||||
var touchId = touchIdentifierStart(touch.identifier);
|
||||
|
||||
var origId = getSurfaceId(touch);
|
||||
var id = getEffectiveEventTarget (origId);
|
||||
@@ -2495,7 +2613,7 @@ function onTouchStart(ev) {
|
||||
var isEmulated = 0;
|
||||
|
||||
if (firstTouchDownId == null) {
|
||||
firstTouchDownId = touch.identifier;
|
||||
firstTouchDownId = touchId;
|
||||
isEmulated = 1;
|
||||
|
||||
if (realWindowWithMouse != origId || id != windowWithMouse) {
|
||||
@@ -2510,52 +2628,54 @@ function onTouchStart(ev) {
|
||||
}
|
||||
}
|
||||
|
||||
sendInput ("t", [0, id, touch.identifier, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
|
||||
sendInput ("t", [0, id, touchId, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
|
||||
}
|
||||
}
|
||||
|
||||
function onTouchMove(ev) {
|
||||
event.preventDefault();
|
||||
ev.preventDefault();
|
||||
|
||||
updateKeyboardStatus();
|
||||
updateForEvent(ev);
|
||||
|
||||
for (var i = 0; i < ev.changedTouches.length; i++) {
|
||||
var touch = ev.changedTouches.item(i);
|
||||
var touchId = touchIdentifier(touch.identifier);
|
||||
|
||||
var origId = getSurfaceId(touch);
|
||||
var id = getEffectiveEventTarget (origId);
|
||||
var pos = getPositionsFromEvent(touch, id);
|
||||
|
||||
var isEmulated = 0;
|
||||
if (firstTouchDownId == touch.identifier) {
|
||||
if (firstTouchDownId == touchId) {
|
||||
isEmulated = 1;
|
||||
}
|
||||
|
||||
sendInput ("t", [1, id, touch.identifier, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
|
||||
sendInput ("t", [1, id, touchId, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
|
||||
}
|
||||
}
|
||||
|
||||
function onTouchEnd(ev) {
|
||||
event.preventDefault();
|
||||
ev.preventDefault();
|
||||
|
||||
updateKeyboardStatus();
|
||||
updateForEvent(ev);
|
||||
|
||||
for (var i = 0; i < ev.changedTouches.length; i++) {
|
||||
var touch = ev.changedTouches.item(i);
|
||||
var touchId = touchIdentifier(touch.identifier);
|
||||
|
||||
var origId = getSurfaceId(touch);
|
||||
var id = getEffectiveEventTarget (origId);
|
||||
var pos = getPositionsFromEvent(touch, id);
|
||||
|
||||
var isEmulated = 0;
|
||||
if (firstTouchDownId == touch.identifier) {
|
||||
if (firstTouchDownId == touchId) {
|
||||
isEmulated = 1;
|
||||
firstTouchDownId = null;
|
||||
}
|
||||
|
||||
sendInput ("t", [2, id, touch.identifier, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
|
||||
sendInput ("t", [2, id, touchId, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2572,11 +2692,11 @@ function setupDocument(document)
|
||||
document.onkeyup = onKeyUp;
|
||||
|
||||
if (document.addEventListener) {
|
||||
document.addEventListener('DOMMouseScroll', onMouseWheel, false);
|
||||
document.addEventListener('mousewheel', onMouseWheel, false);
|
||||
document.addEventListener('touchstart', onTouchStart, false);
|
||||
document.addEventListener('touchmove', onTouchMove, false);
|
||||
document.addEventListener('touchend', onTouchEnd, false);
|
||||
document.addEventListener('DOMMouseScroll', onMouseWheel, passiveSupported ? { passive: false, capture: false } : false);
|
||||
document.addEventListener('mousewheel', onMouseWheel, passiveSupported ? { passive: false, capture: false } : false);
|
||||
document.addEventListener('touchstart', onTouchStart, passiveSupported ? { passive: false, capture: false } : false);
|
||||
document.addEventListener('touchmove', onTouchMove, passiveSupported ? { passive: false, capture: false } : false);
|
||||
document.addEventListener('touchend', onTouchEnd, passiveSupported ? { passive: false, capture: false } : false);
|
||||
} else if (document.attachEvent) {
|
||||
element.attachEvent("onmousewheel", onMouseWheel);
|
||||
}
|
||||
@@ -2630,12 +2750,14 @@ function connect()
|
||||
};
|
||||
|
||||
var iOS = /(iPad|iPhone|iPod)/g.test( navigator.userAgent );
|
||||
if (iOS) {
|
||||
if (iOS || isAndroidChrome) {
|
||||
fakeInput = document.createElement("input");
|
||||
fakeInput.type = "text";
|
||||
fakeInput.style.position = "absolute";
|
||||
fakeInput.style.left = "-1000px";
|
||||
fakeInput.style.top = "-1000px";
|
||||
document.body.appendChild(fakeInput);
|
||||
if (isAndroidChrome)
|
||||
fakeInput.addEventListener('input', onInput, passiveSupported ? { passive: false, capture: false } : false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,6 +224,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
event->scroll.y = message->pointer.win_y;
|
||||
event->scroll.x_root = message->pointer.root_x;
|
||||
event->scroll.y_root = message->pointer.root_y;
|
||||
event->scroll.state = message->pointer.state;
|
||||
event->scroll.direction = message->scroll.dir == 0 ? GDK_SCROLL_UP : GDK_SCROLL_DOWN;
|
||||
gdk_event_set_device (event, device_manager->core_pointer);
|
||||
gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer));
|
||||
|
||||
@@ -226,7 +226,7 @@ gdk_cursor_get_cursor_type (GdkCursor *cursor)
|
||||
*
|
||||
* Creates a new cursor from the set of builtin cursors.
|
||||
*
|
||||
* Returns: a new #GdkCursor
|
||||
* Returns: (nullable) (transfer full): a new #GdkCursor, or %NULL on failure
|
||||
*
|
||||
* Since: 2.2
|
||||
**/
|
||||
|
||||
@@ -278,6 +278,7 @@ free_pointer_info (GdkPointerWindowInfo *info)
|
||||
{
|
||||
if (info->toplevel_under_pointer)
|
||||
g_object_unref (info->toplevel_under_pointer);
|
||||
g_clear_object (&info->last_slave);
|
||||
g_slice_free (GdkPointerWindowInfo, info);
|
||||
}
|
||||
|
||||
|
||||
@@ -585,7 +585,7 @@ gdk_event_new (GdkEventType type)
|
||||
return new_event;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gboolean
|
||||
gdk_event_is_allocated (const GdkEvent *event)
|
||||
{
|
||||
if (event_hash)
|
||||
@@ -663,6 +663,11 @@ gdk_event_copy (const GdkEvent *event)
|
||||
new_private->source_device = private->source_device ? g_object_ref (private->source_device) : NULL;
|
||||
new_private->seat = private->seat;
|
||||
new_private->tool = private->tool;
|
||||
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
new_private->translation_len = private->translation_len;
|
||||
new_private->translation = g_memdup (private->translation, private->translation_len * sizeof (private->translation[0]));
|
||||
#endif
|
||||
}
|
||||
|
||||
switch (event->any.type)
|
||||
@@ -767,6 +772,9 @@ gdk_event_free (GdkEvent *event)
|
||||
private = (GdkEventPrivate *) event;
|
||||
g_clear_object (&private->device);
|
||||
g_clear_object (&private->source_device);
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
g_free (private->translation);
|
||||
#endif
|
||||
}
|
||||
|
||||
switch (event->any.type)
|
||||
@@ -2564,4 +2572,4 @@ gdk_event_get_scancode (GdkEvent *event)
|
||||
|
||||
private = (GdkEventPrivate *) event;
|
||||
return private->key_scancode;
|
||||
}
|
||||
}
|
||||
@@ -505,11 +505,15 @@ _gdk_frame_clock_debug_print_timings (GdkFrameClock *clock,
|
||||
GString *str;
|
||||
|
||||
gint64 previous_frame_time = 0;
|
||||
gint64 previous_smoothed_frame_time = 0;
|
||||
GdkFrameTimings *previous_timings = gdk_frame_clock_get_timings (clock,
|
||||
timings->frame_counter - 1);
|
||||
|
||||
if (previous_timings != NULL)
|
||||
previous_frame_time = previous_timings->frame_time;
|
||||
{
|
||||
previous_frame_time = previous_timings->frame_time;
|
||||
previous_smoothed_frame_time = previous_timings->smoothed_frame_time;
|
||||
}
|
||||
|
||||
str = g_string_new ("");
|
||||
|
||||
@@ -518,6 +522,9 @@ _gdk_frame_clock_debug_print_timings (GdkFrameClock *clock,
|
||||
{
|
||||
g_string_append_printf (str, " interval=%-4.1f", (timings->frame_time - previous_frame_time) / 1000.);
|
||||
g_string_append_printf (str, timings->slept_before ? " (sleep)" : " ");
|
||||
g_string_append_printf (str, " smoothed=%4.1f / %-4.1f",
|
||||
(timings->smoothed_frame_time - timings->frame_time) / 1000.,
|
||||
(timings->smoothed_frame_time - previous_smoothed_frame_time) / 1000.);
|
||||
}
|
||||
if (timings->layout_start_time != 0)
|
||||
g_string_append_printf (str, " layout_start=%-4.1f", (timings->layout_start_time - timings->frame_time) / 1000.);
|
||||
@@ -525,6 +532,8 @@ _gdk_frame_clock_debug_print_timings (GdkFrameClock *clock,
|
||||
g_string_append_printf (str, " paint_start=%-4.1f", (timings->paint_start_time - timings->frame_time) / 1000.);
|
||||
if (timings->frame_end_time != 0)
|
||||
g_string_append_printf (str, " frame_end=%-4.1f", (timings->frame_end_time - timings->frame_time) / 1000.);
|
||||
if (timings->drawn_time != 0)
|
||||
g_string_append_printf (str, " drawn=%-4.1f", (timings->drawn_time - timings->frame_time) / 1000.);
|
||||
if (timings->presentation_time != 0)
|
||||
g_string_append_printf (str, " present=%-4.1f", (timings->presentation_time - timings->frame_time) / 1000.);
|
||||
if (timings->predicted_presentation_time != 0)
|
||||
@@ -566,16 +575,12 @@ gdk_frame_clock_get_refresh_info (GdkFrameClock *frame_clock,
|
||||
gint64 *presentation_time_return)
|
||||
{
|
||||
gint64 frame_counter;
|
||||
gint64 default_refresh_interval = DEFAULT_REFRESH_INTERVAL;
|
||||
|
||||
g_return_if_fail (GDK_IS_FRAME_CLOCK (frame_clock));
|
||||
|
||||
frame_counter = gdk_frame_clock_get_frame_counter (frame_clock);
|
||||
|
||||
if (presentation_time_return)
|
||||
*presentation_time_return = 0;
|
||||
if (refresh_interval_return)
|
||||
*refresh_interval_return = DEFAULT_REFRESH_INTERVAL;
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
GdkFrameTimings *timings = gdk_frame_clock_get_timings (frame_clock, frame_counter);
|
||||
@@ -583,19 +588,21 @@ gdk_frame_clock_get_refresh_info (GdkFrameClock *frame_clock,
|
||||
gint64 refresh_interval;
|
||||
|
||||
if (timings == NULL)
|
||||
return;
|
||||
break;
|
||||
|
||||
refresh_interval = timings->refresh_interval;
|
||||
presentation_time = timings->presentation_time;
|
||||
|
||||
if (refresh_interval == 0)
|
||||
refresh_interval = default_refresh_interval;
|
||||
else
|
||||
default_refresh_interval = refresh_interval;
|
||||
|
||||
if (presentation_time != 0)
|
||||
{
|
||||
if (presentation_time > base_time - MAX_HISTORY_AGE &&
|
||||
presentation_time_return)
|
||||
{
|
||||
if (refresh_interval == 0)
|
||||
refresh_interval = DEFAULT_REFRESH_INTERVAL;
|
||||
|
||||
if (refresh_interval_return)
|
||||
*refresh_interval_return = refresh_interval;
|
||||
|
||||
@@ -604,13 +611,20 @@ gdk_frame_clock_get_refresh_info (GdkFrameClock *frame_clock,
|
||||
|
||||
if (presentation_time_return)
|
||||
*presentation_time_return = presentation_time;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
frame_counter--;
|
||||
}
|
||||
|
||||
if (presentation_time_return)
|
||||
*presentation_time_return = 0;
|
||||
if (refresh_interval_return)
|
||||
*refresh_interval_return = default_refresh_interval;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -36,10 +36,25 @@
|
||||
|
||||
#define FRAME_INTERVAL 16667 /* microseconds */
|
||||
|
||||
typedef enum {
|
||||
SMOOTH_PHASE_STATE_VALID = 0, /* explicit, since we count on zero-init */
|
||||
SMOOTH_PHASE_STATE_AWAIT_FIRST,
|
||||
SMOOTH_PHASE_STATE_AWAIT_DRAWN,
|
||||
} SmoothDeltaState;
|
||||
|
||||
struct _GdkFrameClockIdlePrivate
|
||||
{
|
||||
gint64 frame_time;
|
||||
gint64 min_next_frame_time;
|
||||
gint64 frame_time; /* The exact time we last ran the clock cycle, or 0 if never */
|
||||
gint64 smoothed_frame_time_base; /* A grid-aligned version of frame_time (grid size == refresh period), never more than half a grid from frame_time */
|
||||
gint64 smoothed_frame_time_period; /* The grid size that smoothed_frame_time_base is aligned to */
|
||||
gint64 smoothed_frame_time_reported; /* Ensures we are always monotonic */
|
||||
gint64 smoothed_frame_time_phase; /* The offset of the first reported frame time, in the current animation sequence, from the preceding vsync */
|
||||
gint64 min_next_frame_time; /* We're not synced to vblank, so wait at least until this before next cycle to avoid busy looping */
|
||||
SmoothDeltaState smooth_phase_state; /* The state of smoothed_frame_time_phase - is it valid, awaiting vsync etc. Thanks to zero-init, the initial value
|
||||
of smoothed_frame_time_phase is `0`. This is valid, since we didn't get a "frame drawn" event yet. Accordingly,
|
||||
the initial value of smooth_phase_state is SMOOTH_PHASE_STATE_VALID. See the comment in gdk_frame_clock_paint_idle()
|
||||
for details. */
|
||||
|
||||
gint64 sleep_serial;
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
gint64 freeze_time;
|
||||
@@ -54,6 +69,7 @@ struct _GdkFrameClockIdlePrivate
|
||||
GdkFrameClockPhase phase;
|
||||
|
||||
guint in_paint_idle : 1;
|
||||
guint paint_is_thaw : 1;
|
||||
#ifdef G_OS_WIN32
|
||||
guint begin_period : 1;
|
||||
#endif
|
||||
@@ -124,8 +140,8 @@ gdk_frame_clock_idle_init (GdkFrameClockIdle *frame_clock_idle)
|
||||
frame_clock_idle->priv = priv =
|
||||
gdk_frame_clock_idle_get_instance_private (frame_clock_idle);
|
||||
|
||||
priv->frame_time = g_get_monotonic_time (); /* more sane than zero */
|
||||
priv->freeze_count = 0;
|
||||
priv->smoothed_frame_time_period = FRAME_INTERVAL;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -156,44 +172,107 @@ gdk_frame_clock_idle_dispose (GObject *object)
|
||||
G_OBJECT_CLASS (gdk_frame_clock_idle_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
/* Note: This is never called on first frame, so
|
||||
* smoothed_frame_time_base != 0 and we have a valid frame_interval. */
|
||||
static gint64
|
||||
compute_frame_time (GdkFrameClockIdle *idle)
|
||||
compute_smooth_frame_time (GdkFrameClock *clock,
|
||||
gint64 new_frame_time,
|
||||
gboolean new_frame_time_is_vsync_related,
|
||||
gint64 smoothed_frame_time_base,
|
||||
gint64 frame_interval)
|
||||
{
|
||||
GdkFrameClockIdlePrivate *priv = idle->priv;
|
||||
gint64 computed_frame_time;
|
||||
GdkFrameClockIdlePrivate *priv = GDK_FRAME_CLOCK_IDLE (clock)->priv;
|
||||
int frames_passed;
|
||||
gint64 new_smoothed_time;
|
||||
gint64 current_error;
|
||||
gint64 correction_magnitude;
|
||||
|
||||
computed_frame_time = g_get_monotonic_time ();
|
||||
/* Consecutive frame, assume it is an integer number of frames later, so round to nearest such */
|
||||
/* NOTE: This is >= 0, because smoothed_frame_time_base is < frame_interval/2 from old_frame_time
|
||||
* and new_frame_time >= old_frame_time. */
|
||||
frames_passed = (new_frame_time - smoothed_frame_time_base + frame_interval / 2) / frame_interval;
|
||||
|
||||
/* ensure monotonicity of frame time */
|
||||
if (computed_frame_time <= priv->frame_time)
|
||||
computed_frame_time = priv->frame_time + 1;
|
||||
/* We use an approximately whole number of frames in the future from
|
||||
* last smoothed frame time. This way we avoid minor jitter in the
|
||||
* frame times making the animation speed uneven, but still animate
|
||||
* evenly in case of whole frame skips. */
|
||||
new_smoothed_time = smoothed_frame_time_base + frames_passed * frame_interval;
|
||||
|
||||
return computed_frame_time;
|
||||
/* However, sometimes the smoothed time is too much off from the
|
||||
* real time. For example, if the first frame clock cycle happened
|
||||
* not due to a frame rendering but an input event, then
|
||||
* new_frame_time could happen to be near the middle between two
|
||||
* frames. If that happens and we then start regularly animating at
|
||||
* the refresh_rate, then the jitter in the real time may cause us
|
||||
* to randomly sometimes round up, and sometimes down.
|
||||
*
|
||||
* To combat this we converge the smooth time towards the real time
|
||||
* in a way that is slow when they are near and fast when they are
|
||||
* far from each other.
|
||||
*
|
||||
* This is done by using the square of the error as the correction
|
||||
* magnitude. I.e. if the error is 0.5 frame, we correct by
|
||||
* 0.5*0.5=0.25 frame, if the error is 0.25 we correct by 0.125, if
|
||||
* the error is 0.1, frame we correct by 0.01 frame, etc.
|
||||
*
|
||||
* The actual computation is:
|
||||
* (current_error/frame_interval)*(current_error/frame_interval)*frame_interval
|
||||
* But this can be simplified as below.
|
||||
*
|
||||
* Note: We only do this correction if the new frame is caused by a
|
||||
* thaw of the frame clock, so that we know the time is actually
|
||||
* related to the physical vblank. For frameclock cycles triggered
|
||||
* by other events we always step up in whole frames from the last
|
||||
* reported time.
|
||||
*/
|
||||
if (new_frame_time_is_vsync_related)
|
||||
{
|
||||
current_error = new_smoothed_time - new_frame_time;
|
||||
correction_magnitude = current_error * current_error / frame_interval; /* Note, this is always > 0 due to the square */
|
||||
if (current_error > 0)
|
||||
new_smoothed_time -= correction_magnitude;
|
||||
else
|
||||
new_smoothed_time += correction_magnitude;
|
||||
}
|
||||
|
||||
/* Ensure we're always monotonic */
|
||||
if (new_smoothed_time <= priv->smoothed_frame_time_reported)
|
||||
new_smoothed_time = priv->smoothed_frame_time_reported;
|
||||
|
||||
return new_smoothed_time;
|
||||
}
|
||||
|
||||
static gint64
|
||||
gdk_frame_clock_idle_get_frame_time (GdkFrameClock *clock)
|
||||
{
|
||||
GdkFrameClockIdlePrivate *priv = GDK_FRAME_CLOCK_IDLE (clock)->priv;
|
||||
gint64 computed_frame_time;
|
||||
gint64 now;
|
||||
gint64 new_smoothed_time;
|
||||
|
||||
/* can't change frame time during a paint */
|
||||
if (priv->phase != GDK_FRAME_CLOCK_PHASE_NONE &&
|
||||
priv->phase != GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS)
|
||||
return priv->frame_time;
|
||||
priv->phase != GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS &&
|
||||
(priv->phase != GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT || priv->in_paint_idle))
|
||||
return priv->smoothed_frame_time_base;
|
||||
|
||||
/* Outside a paint, pick something close to "now" */
|
||||
computed_frame_time = compute_frame_time (GDK_FRAME_CLOCK_IDLE (clock));
|
||||
/* Outside a paint, pick something smoothed close to now */
|
||||
now = g_get_monotonic_time ();
|
||||
|
||||
/* 16ms is 60fps. We only update frame time that often because we'd
|
||||
* like to try to keep animations on the same start times.
|
||||
* get_frame_time() would normally be used outside of a paint to
|
||||
* record an animation start time for example.
|
||||
*/
|
||||
if ((computed_frame_time - priv->frame_time) > FRAME_INTERVAL)
|
||||
priv->frame_time = computed_frame_time;
|
||||
/* First time frame, just return something */
|
||||
if (priv->smoothed_frame_time_base == 0)
|
||||
{
|
||||
priv->smoothed_frame_time_reported = now;
|
||||
return now;
|
||||
}
|
||||
|
||||
return priv->frame_time;
|
||||
/* Since time is monotonic this is <= what we will pick for the next cycle, but
|
||||
more likely than not it will be equal if we're doing a constant animation. */
|
||||
new_smoothed_time = compute_smooth_frame_time (clock, now, FALSE,
|
||||
priv->smoothed_frame_time_base,
|
||||
priv->smoothed_frame_time_period);
|
||||
|
||||
priv->smoothed_frame_time_reported = new_smoothed_time;
|
||||
return new_smoothed_time;
|
||||
}
|
||||
|
||||
#define RUN_FLUSH_IDLE(priv) \
|
||||
@@ -211,7 +290,8 @@ gdk_frame_clock_idle_get_frame_time (GdkFrameClock *clock)
|
||||
(priv)->updating_count > 0))
|
||||
|
||||
static void
|
||||
maybe_start_idle (GdkFrameClockIdle *clock_idle)
|
||||
maybe_start_idle (GdkFrameClockIdle *clock_idle,
|
||||
gboolean caused_by_thaw)
|
||||
{
|
||||
GdkFrameClockIdlePrivate *priv = clock_idle->priv;
|
||||
|
||||
@@ -221,7 +301,7 @@ maybe_start_idle (GdkFrameClockIdle *clock_idle)
|
||||
|
||||
if (priv->min_next_frame_time != 0)
|
||||
{
|
||||
gint64 now = compute_frame_time (clock_idle);
|
||||
gint64 now = g_get_monotonic_time ();
|
||||
gint64 min_interval_us = MAX (priv->min_next_frame_time, now) - now;
|
||||
min_interval = (min_interval_us + 500) / 1000;
|
||||
}
|
||||
@@ -239,6 +319,7 @@ maybe_start_idle (GdkFrameClockIdle *clock_idle)
|
||||
if (!priv->in_paint_idle &&
|
||||
priv->paint_idle_id == 0 && RUN_PAINT_IDLE (priv))
|
||||
{
|
||||
priv->paint_is_thaw = caused_by_thaw;
|
||||
priv->paint_idle_id = gdk_threads_add_timeout_full (GDK_PRIORITY_REDRAW,
|
||||
min_interval,
|
||||
gdk_frame_clock_paint_idle,
|
||||
@@ -267,23 +348,6 @@ maybe_stop_idle (GdkFrameClockIdle *clock_idle)
|
||||
}
|
||||
}
|
||||
|
||||
static gint64
|
||||
compute_min_next_frame_time (GdkFrameClockIdle *clock_idle,
|
||||
gint64 last_frame_time)
|
||||
{
|
||||
gint64 presentation_time;
|
||||
gint64 refresh_interval;
|
||||
|
||||
gdk_frame_clock_get_refresh_info (GDK_FRAME_CLOCK (clock_idle),
|
||||
last_frame_time,
|
||||
&refresh_interval, &presentation_time);
|
||||
|
||||
if (presentation_time == 0)
|
||||
return last_frame_time + refresh_interval;
|
||||
else
|
||||
return presentation_time + refresh_interval / 2;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_frame_clock_flush_idle (void *data)
|
||||
{
|
||||
@@ -310,6 +374,25 @@ gdk_frame_clock_flush_idle (void *data)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the positive remainder.
|
||||
*
|
||||
* As an example, lets consider (-5) % 16:
|
||||
*
|
||||
* (-5) % 16 = (0 * 16) + (-5) = -5
|
||||
*
|
||||
* If we only want positive remainders, we can instead calculate
|
||||
*
|
||||
* (-5) % 16 = (1 * 16) + (-5) = 11
|
||||
*
|
||||
* The built-in `%` operator returns the former, positive_modulo() returns the latter.
|
||||
*/
|
||||
static int
|
||||
positive_modulo (int i, int n)
|
||||
{
|
||||
return (i % n + n) % n;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_frame_clock_paint_idle (void *data)
|
||||
{
|
||||
@@ -343,39 +426,103 @@ gdk_frame_clock_paint_idle (void *data)
|
||||
if (priv->freeze_count == 0)
|
||||
{
|
||||
gint64 frame_interval = FRAME_INTERVAL;
|
||||
gint64 reset_frame_time;
|
||||
gint64 smoothest_frame_time;
|
||||
gint64 frame_time_error;
|
||||
GdkFrameTimings *prev_timings =
|
||||
gdk_frame_clock_get_current_timings (clock);
|
||||
GdkFrameTimings *prev_timings = gdk_frame_clock_get_current_timings (clock);
|
||||
|
||||
if (prev_timings && prev_timings->refresh_interval)
|
||||
frame_interval = prev_timings->refresh_interval;
|
||||
|
||||
/* We are likely not getting precisely even callbacks in real
|
||||
* time, particularly if the event loop is busy.
|
||||
* This is a documented limitation in the precision of
|
||||
* gdk_threads_add_timeout_full and g_timeout_add_full.
|
||||
priv->frame_time = g_get_monotonic_time ();
|
||||
|
||||
/*
|
||||
* The first clock cycle of an animation might have been triggered by some external event. An external
|
||||
* event can be an input event, an expired timer, data arriving over the network etc. This can happen at
|
||||
* any time, so the cycle could have been scheduled at some random time rather then immediately after a
|
||||
* frame completion. The offset between the start of the first animation cycle and the preceding vsync is
|
||||
* called the "phase" of the clock cycle start time (not to be confused with the phase of the frame
|
||||
* clock).
|
||||
*
|
||||
* In order to avoid this imprecision from compounding between
|
||||
* frames and affecting visual smoothness, we correct frame_time
|
||||
* to more precisely match the even refresh interval of the
|
||||
* physical display. This also means we proactively avoid (most)
|
||||
* missed frames before they occur.
|
||||
* In this first clock cycle, the "smooth" frame time is simply the time when the cycle was started. This
|
||||
* could be followed by several cycles which are not vsync-related. As long as we don't get a "frame
|
||||
* drawn" signal from the compositor, the clock cycles will occur every about frame_interval. Once we do
|
||||
* get a "frame drawn" signal, from this point on the frame clock cycles will start shortly after the
|
||||
* corresponding vsync signals, again every about frame_interval. The first vsync-related clock cycle
|
||||
* might occur less than a refresh interval away from the last non-vsync-related cycle. See the diagram
|
||||
* below for details. So while the cadence stays the same - a frame clock cycle every about frame_interval
|
||||
* - the phase of the cycles start time has changed.
|
||||
*
|
||||
* Since we might have already reported the frame time to the application in the previous clock cycles, we
|
||||
* have to adjust future reported frame times. We want the first vsync-related smooth time to be separated
|
||||
* by exactly 1 frame_interval from the previous one, in order to maintain the regularity of the reported
|
||||
* frame times. To achieve that, from this point on we add the phase of the first clock cycle start time to
|
||||
* the smooth time. In order to compute that phase, accounting for possible skipped frames (e.g. due to
|
||||
* compositor stalls), we want the following to be true:
|
||||
*
|
||||
* first_vsync_smooth_time = last_non_vsync_smooth_time + frame_interval * (1 + frames_skipped)
|
||||
*
|
||||
* We can assign the following known/desired values to the above equation:
|
||||
*
|
||||
* last_non_vsync_smooth_time = smoothed_frame_time_base
|
||||
* first_vsync_smooth_time = frame_time + smoothed_frame_time_phase
|
||||
*
|
||||
* That leads us to the following, from which we can extract smoothed_frame_time_phase:
|
||||
*
|
||||
* frame_time + smoothed_frame_time_phase = smoothed_frame_time_base +
|
||||
* frame_interval * (1 + frames_skipped)
|
||||
*
|
||||
* In the following diagram, '|' mark a vsync, '*' mark the start of a clock cycle, '+' is the adjusted
|
||||
* frame time, '!' marks the reception of "frame drawn" events from the compositor. Note that the clock
|
||||
* cycle cadence changed after the first vsync-related cycle. This cadence is kept even if we don't
|
||||
* receive a 'frame drawn' signal in a subsequent frame, since then we schedule the clock at intervals of
|
||||
* refresh_interval.
|
||||
*
|
||||
* vsync | | | | | |...
|
||||
* frame drawn | | |! |! | |...
|
||||
* cycle start | * | * |* |* |* |...
|
||||
* adjusted times | * | * | + | + | + |...
|
||||
* phase ^------^
|
||||
*/
|
||||
smoothest_frame_time = priv->frame_time + frame_interval;
|
||||
reset_frame_time = compute_frame_time (clock_idle);
|
||||
frame_time_error = ABS (reset_frame_time - smoothest_frame_time);
|
||||
if (frame_time_error >= frame_interval)
|
||||
priv->frame_time = reset_frame_time;
|
||||
if (priv->smooth_phase_state == SMOOTH_PHASE_STATE_AWAIT_FIRST)
|
||||
{
|
||||
/* First animation cycle - usually unrelated to vsync */
|
||||
priv->smoothed_frame_time_base = 0;
|
||||
priv->smoothed_frame_time_phase = 0;
|
||||
priv->smooth_phase_state = SMOOTH_PHASE_STATE_AWAIT_DRAWN;
|
||||
}
|
||||
else if (priv->smooth_phase_state == SMOOTH_PHASE_STATE_AWAIT_DRAWN &&
|
||||
priv->paint_is_thaw)
|
||||
{
|
||||
/* First vsync-related animation cycle, we can now compute the phase. We want the phase to satisfy
|
||||
0 <= phase < frame_interval */
|
||||
priv->smoothed_frame_time_phase =
|
||||
positive_modulo (priv->smoothed_frame_time_base - priv->frame_time,
|
||||
frame_interval);
|
||||
priv->smooth_phase_state = SMOOTH_PHASE_STATE_VALID;
|
||||
}
|
||||
|
||||
if (priv->smoothed_frame_time_base == 0)
|
||||
{
|
||||
/* First frame ever, or first cycle in a new animation sequence. Ensure monotonicity */
|
||||
priv->smoothed_frame_time_base = MAX (priv->frame_time, priv->smoothed_frame_time_reported);
|
||||
}
|
||||
else
|
||||
priv->frame_time = smoothest_frame_time;
|
||||
{
|
||||
/* compute_smooth_frame_time() ensures monotonicity */
|
||||
priv->smoothed_frame_time_base =
|
||||
compute_smooth_frame_time (clock, priv->frame_time + priv->smoothed_frame_time_phase,
|
||||
priv->paint_is_thaw,
|
||||
priv->smoothed_frame_time_base,
|
||||
priv->smoothed_frame_time_period);
|
||||
}
|
||||
|
||||
priv->smoothed_frame_time_period = frame_interval;
|
||||
priv->smoothed_frame_time_reported = priv->smoothed_frame_time_base;
|
||||
|
||||
_gdk_frame_clock_begin_frame (clock);
|
||||
/* Note "current" is different now so timings != prev_timings */
|
||||
timings = gdk_frame_clock_get_current_timings (clock);
|
||||
|
||||
timings->frame_time = priv->frame_time;
|
||||
timings->smoothed_frame_time = priv->smoothed_frame_time_base;
|
||||
timings->slept_before = priv->sleep_serial != get_sleep_serial ();
|
||||
|
||||
priv->phase = GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT;
|
||||
@@ -496,9 +643,20 @@ gdk_frame_clock_paint_idle (void *data)
|
||||
*/
|
||||
if (priv->freeze_count == 0)
|
||||
{
|
||||
priv->min_next_frame_time = compute_min_next_frame_time (clock_idle,
|
||||
priv->frame_time);
|
||||
maybe_start_idle (clock_idle);
|
||||
/*
|
||||
* If we don't receive "frame drawn" events, smooth_cycle_start will simply be advanced in constant increments of
|
||||
* the refresh interval. That way we get absolute target times for the next cycles, which should prevent skewing
|
||||
* in the scheduling of the frame clock.
|
||||
*
|
||||
* Once we do receive "frame drawn" events, smooth_cycle_start will track the vsync, and do so in a more stable
|
||||
* way compared to frame_time. If we then no longer receive "frame drawn" events, smooth_cycle_start will again be
|
||||
* simply advanced in increments of the refresh interval, but this time we are in sync with the vsync. If we start
|
||||
* receiving "frame drawn" events shortly after loosing them, then we should still be in sync.
|
||||
*/
|
||||
gint64 smooth_cycle_start = priv->smoothed_frame_time_base - priv->smoothed_frame_time_phase;
|
||||
priv->min_next_frame_time = smooth_cycle_start + priv->smoothed_frame_time_period;
|
||||
|
||||
maybe_start_idle (clock_idle, FALSE);
|
||||
}
|
||||
|
||||
if (priv->freeze_count == 0)
|
||||
@@ -515,7 +673,7 @@ gdk_frame_clock_idle_request_phase (GdkFrameClock *clock,
|
||||
GdkFrameClockIdlePrivate *priv = clock_idle->priv;
|
||||
|
||||
priv->requested |= phase;
|
||||
maybe_start_idle (clock_idle);
|
||||
maybe_start_idle (clock_idle, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -533,8 +691,13 @@ gdk_frame_clock_idle_begin_updating (GdkFrameClock *clock)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (priv->updating_count == 0)
|
||||
{
|
||||
priv->smooth_phase_state = SMOOTH_PHASE_STATE_AWAIT_FIRST;
|
||||
}
|
||||
|
||||
priv->updating_count++;
|
||||
maybe_start_idle (clock_idle);
|
||||
maybe_start_idle (clock_idle, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -548,6 +711,11 @@ gdk_frame_clock_idle_end_updating (GdkFrameClock *clock)
|
||||
priv->updating_count--;
|
||||
maybe_stop_idle (clock_idle);
|
||||
|
||||
if (priv->updating_count == 0)
|
||||
{
|
||||
priv->smooth_phase_state = SMOOTH_PHASE_STATE_VALID;
|
||||
}
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
if (priv->updating_count == 0 && priv->begin_period)
|
||||
{
|
||||
@@ -586,7 +754,7 @@ gdk_frame_clock_idle_thaw (GdkFrameClock *clock)
|
||||
priv->freeze_count--;
|
||||
if (priv->freeze_count == 0)
|
||||
{
|
||||
maybe_start_idle (clock_idle);
|
||||
maybe_start_idle (clock_idle, TRUE);
|
||||
/* If nothing is requested so we didn't start an idle, we need
|
||||
* to skip to the end of the state chain, since the idle won't
|
||||
* run and do it for us.
|
||||
|
||||
@@ -89,6 +89,7 @@ struct _GdkFrameTimings
|
||||
gint64 frame_counter;
|
||||
guint64 cookie;
|
||||
gint64 frame_time;
|
||||
gint64 smoothed_frame_time;
|
||||
gint64 drawn_time;
|
||||
gint64 presentation_time;
|
||||
gint64 refresh_interval;
|
||||
|
||||
@@ -192,6 +192,11 @@ struct _GdkEventPrivate
|
||||
GdkSeat *seat;
|
||||
GdkDeviceTool *tool;
|
||||
guint16 key_scancode;
|
||||
|
||||
#ifdef GDK_WINDOWING_WIN32
|
||||
gunichar2 *translation;
|
||||
guint translation_len;
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef struct _GdkWindowPaint GdkWindowPaint;
|
||||
@@ -413,6 +418,10 @@ void gdk_event_set_scancode (GdkEvent *event,
|
||||
void gdk_event_set_seat (GdkEvent *event,
|
||||
GdkSeat *seat);
|
||||
|
||||
/* The IME IM module needs this symbol exported. */
|
||||
_GDK_EXTERN
|
||||
gboolean gdk_event_is_allocated (const GdkEvent *event);
|
||||
|
||||
void _gdk_event_emit (GdkEvent *event);
|
||||
GList* _gdk_event_queue_find_first (GdkDisplay *display);
|
||||
void _gdk_event_queue_remove_link (GdkDisplay *display,
|
||||
|
||||
@@ -274,6 +274,10 @@
|
||||
#define GDK_dead_invertedbreve 0xfe6d
|
||||
#define GDK_dead_belowcomma 0xfe6e
|
||||
#define GDK_dead_currency 0xfe6f
|
||||
#define GDK_dead_lowline 0xfe90
|
||||
#define GDK_dead_aboveverticalline 0xfe91
|
||||
#define GDK_dead_belowverticalline 0xfe92
|
||||
#define GDK_dead_longsolidusoverlay 0xfe93
|
||||
#define GDK_dead_a 0xfe80
|
||||
#define GDK_dead_A 0xfe81
|
||||
#define GDK_dead_e 0xfe82
|
||||
@@ -2279,6 +2283,10 @@
|
||||
#define GDK_TouchpadOn 0x1008ffb0
|
||||
#define GDK_TouchpadOff 0x1008ffb1
|
||||
#define GDK_AudioMicMute 0x1008ffb2
|
||||
#define GDK_Keyboard 0x1008ffb3
|
||||
#define GDK_WWAN 0x1008ffb4
|
||||
#define GDK_RFKill 0x1008ffb5
|
||||
#define GDK_AudioPreset 0x1008ffb6
|
||||
#define GDK_Switch_VT_1 0x1008fe01
|
||||
#define GDK_Switch_VT_2 0x1008fe02
|
||||
#define GDK_Switch_VT_3 0x1008fe03
|
||||
|
||||
@@ -283,6 +283,10 @@
|
||||
#define GDK_KEY_dead_invertedbreve 0xfe6d
|
||||
#define GDK_KEY_dead_belowcomma 0xfe6e
|
||||
#define GDK_KEY_dead_currency 0xfe6f
|
||||
#define GDK_KEY_dead_lowline 0xfe90
|
||||
#define GDK_KEY_dead_aboveverticalline 0xfe91
|
||||
#define GDK_KEY_dead_belowverticalline 0xfe92
|
||||
#define GDK_KEY_dead_longsolidusoverlay 0xfe93
|
||||
#define GDK_KEY_dead_a 0xfe80
|
||||
#define GDK_KEY_dead_A 0xfe81
|
||||
#define GDK_KEY_dead_e 0xfe82
|
||||
@@ -2288,6 +2292,10 @@
|
||||
#define GDK_KEY_TouchpadOn 0x1008ffb0
|
||||
#define GDK_KEY_TouchpadOff 0x1008ffb1
|
||||
#define GDK_KEY_AudioMicMute 0x1008ffb2
|
||||
#define GDK_KEY_Keyboard 0x1008ffb3
|
||||
#define GDK_KEY_WWAN 0x1008ffb4
|
||||
#define GDK_KEY_RFKill 0x1008ffb5
|
||||
#define GDK_KEY_AudioPreset 0x1008ffb6
|
||||
#define GDK_KEY_Switch_VT_1 0x1008fe01
|
||||
#define GDK_KEY_Switch_VT_2 0x1008fe02
|
||||
#define GDK_KEY_Switch_VT_3 0x1008fe03
|
||||
|
||||
@@ -646,6 +646,7 @@ gdk_offscreen_window_set_wmfunctions (GdkWindow *window,
|
||||
|
||||
static void
|
||||
gdk_offscreen_window_begin_move_drag (GdkWindow *window,
|
||||
GdkDevice *device,
|
||||
gint button,
|
||||
gint root_x,
|
||||
gint root_y,
|
||||
|
||||
@@ -288,6 +288,7 @@ gdk_pixbuf_get_from_surface (cairo_surface_t *surface,
|
||||
if (cairo_surface_status (surface) || dest == NULL)
|
||||
{
|
||||
cairo_surface_destroy (surface);
|
||||
g_clear_object (&dest);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -9931,7 +9931,7 @@ _gdk_windowing_got_event (GdkDisplay *display,
|
||||
|
||||
if (source_device != pointer_info->last_slave &&
|
||||
gdk_device_get_device_type (source_device) == GDK_DEVICE_TYPE_SLAVE)
|
||||
pointer_info->last_slave = source_device;
|
||||
g_set_object (&pointer_info->last_slave, source_device);
|
||||
else if (pointer_info->last_slave)
|
||||
source_device = pointer_info->last_slave;
|
||||
}
|
||||
@@ -10200,7 +10200,7 @@ gdk_window_create_similar_surface (GdkWindow * window,
|
||||
* gdk_window_create_similar_image_surface:
|
||||
* @window: (nullable): window to make new surface similar to, or
|
||||
* %NULL if none
|
||||
* @format: (type int): the format for the new surface
|
||||
* @format: the format for the new surface
|
||||
* @width: width of the new surface
|
||||
* @height: height of the new surface
|
||||
* @scale: the scale of the new surface, or 0 to use same as @window
|
||||
|
||||
@@ -185,9 +185,9 @@
|
||||
|
||||
-(void)doCommandBySelector: (SEL)aSelector
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("doCommandBySelector"));
|
||||
if ([self respondsToSelector: aSelector])
|
||||
[self performSelector: aSelector];
|
||||
GDK_NOTE (EVENTS, g_message ("doCommandBySelector %s", aSelector));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)insertText: (id)aString replacementRange: (NSRange)replacementRange
|
||||
@@ -246,335 +246,6 @@
|
||||
_gdk_quartz_synthesize_null_key_event(gdk_window);
|
||||
}
|
||||
}
|
||||
|
||||
-(void)deleteBackward: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("deleteBackward"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)deleteForward: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("deleteForward"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)deleteToBeginningOfLine: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("deleteToBeginningOfLine"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)deleteToEndOfLine: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("deleteToEndOfLine"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)deleteWordBackward: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("deleteWordBackward"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)deleteWordForward: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("deleteWordForward"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)insertBacktab: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("insertBacktab"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)insertNewline: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("insertNewline"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)insertTab: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("insertTab"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveBackward: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveBackward"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveBackwardAndModifySelection: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveBackwardAndModifySelection"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveDown: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveDown"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveDownAndModifySelection: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveDownAndModifySelection"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveForward: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveForward"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveForwardAndModifySelection: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveForwardAndModifySelection"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveLeft: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveLeft"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveLeftAndModifySelection: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveLeftAndModifySelection"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveRight: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveRight"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveRightAndModifySelection: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveRightAndModifySelection"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveToBeginningOfDocument: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfDocument"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveToBeginningOfDocumentAndModifySelection: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfDocumentAndModifySelection"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveToBeginningOfLine: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfLine"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveToBeginningOfLineAndModifySelection: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfLineAndModifySelection"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveToEndOfDocument: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveToEndOfDocument"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveToEndOfDocumentAndModifySelection: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveToEndOfDocumentAndModifySelection"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveToEndOfLine: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveToEndOfLine"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveToEndOfLineAndModifySelection: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveToEndOfLineAndModifySelection"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveUp: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveUp"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveUpAndModifySelection: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveUpAndModifySelection"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveWordBackward: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveWordBackward"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveWordBackwardAndModifySelection: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveWordBackwardAndModifySelection"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveWordForward: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveWordForward"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveWordForwardAndModifySelection: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveWordForwardAndModifySelection"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveWordLeft: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveWordLeft"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveWordLeftAndModifySelection: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveWordLeftAndModifySelection"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveWordRight: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveWordRight"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)moveWordRightAndModifySelection: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("moveWordRightAndModifySelection"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)pageDown: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("pageDown"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)pageDownAndModifySelection: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("pageDownAndModifySelection"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)pageUp: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("pageUp"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)pageUpAndModifySelection: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("pageUpAndModifySelection"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)scrollPageDown: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("scrollPageDown"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)scrollPageUp: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("scrollPageUp"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)selectAll: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("selectAll"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)selectLine: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("selectLine"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)selectWord: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("selectWord"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
-(void)noop: (id)sender
|
||||
{
|
||||
GDK_NOTE (EVENTS, g_message ("noop"));
|
||||
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
|
||||
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------- */
|
||||
|
||||
-(void)dealloc
|
||||
|
||||
@@ -31,6 +31,10 @@
|
||||
struct _GdkQuartzDeviceCore
|
||||
{
|
||||
GdkDevice parent_instance;
|
||||
|
||||
gboolean active;
|
||||
NSUInteger device_id;
|
||||
unsigned long long unique_id;
|
||||
};
|
||||
|
||||
struct _GdkQuartzDeviceCoreClass
|
||||
@@ -364,3 +368,36 @@ gdk_quartz_device_core_select_window_events (GdkDevice *device,
|
||||
{
|
||||
/* The mask is set in the common code. */
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_quartz_device_core_set_active (GdkDevice *device,
|
||||
gboolean active,
|
||||
NSUInteger device_id)
|
||||
{
|
||||
GdkQuartzDeviceCore *self = GDK_QUARTZ_DEVICE_CORE (device);
|
||||
|
||||
self->active = active;
|
||||
self->device_id = device_id;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_quartz_device_core_is_active (GdkDevice *device,
|
||||
NSUInteger device_id)
|
||||
{
|
||||
GdkQuartzDeviceCore *self = GDK_QUARTZ_DEVICE_CORE (device);
|
||||
|
||||
return (self->active && self->device_id == device_id);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_quartz_device_core_set_unique (GdkDevice *device,
|
||||
unsigned long long unique_id)
|
||||
{
|
||||
GDK_QUARTZ_DEVICE_CORE (device)->unique_id = unique_id;
|
||||
}
|
||||
|
||||
unsigned long long
|
||||
_gdk_quartz_device_core_get_unique (GdkDevice *device)
|
||||
{
|
||||
return GDK_QUARTZ_DEVICE_CORE (device)->unique_id;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,20 @@
|
||||
#include "gdkquartzdevice-core.h"
|
||||
#include "gdkkeysyms.h"
|
||||
#include "gdkprivate-quartz.h"
|
||||
#include "gdkinternal-quartz.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101200
|
||||
GDK_QUARTZ_POINTER_DEVICE_TYPE_CURSOR = NSCursorPointingDevice,
|
||||
GDK_QUARTZ_POINTER_DEVICE_TYPE_ERASER = NSEraserPointingDevice,
|
||||
GDK_QUARTZ_POINTER_DEVICE_TYPE_PEN = NSPenPointingDevice,
|
||||
#else
|
||||
GDK_QUARTZ_POINTER_DEVICE_TYPE_CURSOR = NSPointingDeviceTypeCursor,
|
||||
GDK_QUARTZ_POINTER_DEVICE_TYPE_ERASER = NSPointingDeviceTypeEraser,
|
||||
GDK_QUARTZ_POINTER_DEVICE_TYPE_PEN = NSPointingDeviceTypePen,
|
||||
#endif
|
||||
} GdkQuartzPointerDeviceType;
|
||||
|
||||
#define HAS_FOCUS(toplevel) \
|
||||
((toplevel)->has_focus || (toplevel)->has_pointer_focus)
|
||||
@@ -87,6 +100,7 @@ create_core_keyboard (GdkDeviceManager *device_manager,
|
||||
static void
|
||||
gdk_quartz_device_manager_core_init (GdkQuartzDeviceManagerCore *device_manager)
|
||||
{
|
||||
device_manager->known_tablet_devices = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -99,6 +113,8 @@ gdk_quartz_device_manager_core_finalize (GObject *object)
|
||||
g_object_unref (quartz_device_manager_core->core_pointer);
|
||||
g_object_unref (quartz_device_manager_core->core_keyboard);
|
||||
|
||||
g_list_free_full (quartz_device_manager_core->known_tablet_devices, g_object_unref);
|
||||
|
||||
G_OBJECT_CLASS (gdk_quartz_device_manager_core_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
@@ -127,16 +143,25 @@ static GList *
|
||||
gdk_quartz_device_manager_core_list_devices (GdkDeviceManager *device_manager,
|
||||
GdkDeviceType type)
|
||||
{
|
||||
GdkQuartzDeviceManagerCore *quartz_device_manager_core;
|
||||
GdkQuartzDeviceManagerCore *self;
|
||||
GList *devices = NULL;
|
||||
GList *l;
|
||||
|
||||
self = GDK_QUARTZ_DEVICE_MANAGER_CORE (device_manager);
|
||||
|
||||
if (type == GDK_DEVICE_TYPE_MASTER)
|
||||
{
|
||||
quartz_device_manager_core = (GdkQuartzDeviceManagerCore *) device_manager;
|
||||
devices = g_list_prepend (devices, quartz_device_manager_core->core_keyboard);
|
||||
devices = g_list_prepend (devices, quartz_device_manager_core->core_pointer);
|
||||
devices = g_list_prepend (devices, self->core_keyboard);
|
||||
devices = g_list_prepend (devices, self->core_pointer);
|
||||
}
|
||||
|
||||
for (l = self->known_tablet_devices; l; l = g_list_next (l))
|
||||
{
|
||||
devices = g_list_prepend (devices, GDK_DEVICE (l->data));
|
||||
}
|
||||
|
||||
devices = g_list_reverse (devices);
|
||||
|
||||
return devices;
|
||||
}
|
||||
|
||||
@@ -148,3 +173,200 @@ gdk_quartz_device_manager_core_get_client_pointer (GdkDeviceManager *device_mana
|
||||
quartz_device_manager_core = (GdkQuartzDeviceManagerCore *) device_manager;
|
||||
return quartz_device_manager_core->core_pointer;
|
||||
}
|
||||
|
||||
static GdkDevice *
|
||||
create_core_device (GdkDeviceManager *device_manager,
|
||||
const gchar *device_name,
|
||||
GdkInputSource source)
|
||||
{
|
||||
GdkDisplay *display = gdk_device_manager_get_display (device_manager);
|
||||
GdkDevice *device = g_object_new (GDK_TYPE_QUARTZ_DEVICE_CORE,
|
||||
"name", device_name,
|
||||
"type", GDK_DEVICE_TYPE_SLAVE,
|
||||
"input-source", source,
|
||||
"input-mode", GDK_MODE_DISABLED,
|
||||
"has-cursor", FALSE,
|
||||
"display", display,
|
||||
"device-manager", device_manager,
|
||||
NULL);
|
||||
|
||||
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_PRESSURE, 0.0, 1.0, 0.001);
|
||||
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_XTILT, -1.0, 1.0, 0.001);
|
||||
_gdk_device_add_axis (device, GDK_NONE, GDK_AXIS_YTILT, -1.0, 1.0, 0.001);
|
||||
|
||||
return device;
|
||||
}
|
||||
|
||||
static void
|
||||
mimic_device_axes (GdkDevice *logical,
|
||||
GdkDevice *physical)
|
||||
{
|
||||
double axis_min, axis_max, axis_resolution;
|
||||
GdkAtom axis_label;
|
||||
GdkAxisUse axis_use;
|
||||
int axis_count;
|
||||
int i;
|
||||
|
||||
axis_count = gdk_device_get_n_axes (physical);
|
||||
|
||||
for (i = 0; i < axis_count; i++)
|
||||
{
|
||||
_gdk_device_get_axis_info (physical, i, &axis_label, &axis_use, &axis_min,
|
||||
&axis_max, &axis_resolution);
|
||||
_gdk_device_add_axis (logical, axis_label, axis_use, axis_min,
|
||||
axis_max, axis_resolution);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
translate_device_axes (GdkDevice *source_device,
|
||||
gboolean active)
|
||||
{
|
||||
GdkSeat *seat = gdk_display_get_default_seat (_gdk_display);
|
||||
GdkDevice *core_pointer = gdk_seat_get_pointer (seat);
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (core_pointer));
|
||||
|
||||
_gdk_device_reset_axes (core_pointer);
|
||||
if (active && source_device)
|
||||
{
|
||||
mimic_device_axes (core_pointer, source_device);
|
||||
}
|
||||
else
|
||||
{
|
||||
_gdk_device_add_axis (core_pointer, GDK_NONE, GDK_AXIS_X, 0, 0, 1);
|
||||
_gdk_device_add_axis (core_pointer, GDK_NONE, GDK_AXIS_Y, 0, 0, 1);
|
||||
}
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (core_pointer));
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_quartz_device_manager_register_device_for_ns_event (GdkDeviceManager *device_manager,
|
||||
NSEvent *nsevent)
|
||||
{
|
||||
GdkQuartzDeviceManagerCore *self = GDK_QUARTZ_DEVICE_MANAGER_CORE (device_manager);
|
||||
GList *l = NULL;
|
||||
GdkInputSource input_source = GDK_SOURCE_MOUSE;
|
||||
GdkDevice *device = NULL;
|
||||
|
||||
/* Only handle device updates for proximity events */
|
||||
if ([nsevent type] != GDK_QUARTZ_EVENT_TABLET_PROXIMITY &&
|
||||
[nsevent subtype] != GDK_QUARTZ_EVENT_SUBTYPE_TABLET_PROXIMITY)
|
||||
return;
|
||||
|
||||
if ([nsevent pointingDeviceType] == GDK_QUARTZ_POINTER_DEVICE_TYPE_PEN)
|
||||
input_source = GDK_SOURCE_PEN;
|
||||
else if ([nsevent pointingDeviceType] == GDK_QUARTZ_POINTER_DEVICE_TYPE_CURSOR)
|
||||
input_source = GDK_SOURCE_CURSOR;
|
||||
else if ([nsevent pointingDeviceType] == GDK_QUARTZ_POINTER_DEVICE_TYPE_ERASER)
|
||||
input_source = GDK_SOURCE_ERASER;
|
||||
|
||||
for (l = self->known_tablet_devices; l; l = g_list_next (l))
|
||||
{
|
||||
GdkDevice *device_to_check = GDK_DEVICE (l->data);
|
||||
|
||||
if (input_source == gdk_device_get_source (device_to_check) &&
|
||||
[nsevent uniqueID] == _gdk_quartz_device_core_get_unique (device_to_check))
|
||||
{
|
||||
device = device_to_check;
|
||||
if ([nsevent isEnteringProximity])
|
||||
{
|
||||
if (!_gdk_quartz_device_core_is_active (device, [nsevent deviceID]))
|
||||
self->num_active_devices++;
|
||||
|
||||
_gdk_quartz_device_core_set_active (device, TRUE, [nsevent deviceID]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_gdk_quartz_device_core_is_active (device, [nsevent deviceID]))
|
||||
self->num_active_devices--;
|
||||
|
||||
_gdk_quartz_device_core_set_active (device, FALSE, [nsevent deviceID]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* If we haven't seen this device before, add it */
|
||||
if (!device)
|
||||
{
|
||||
GdkSeat *seat;
|
||||
|
||||
switch (input_source)
|
||||
{
|
||||
case GDK_SOURCE_PEN:
|
||||
device = create_core_device (device_manager,
|
||||
"Quartz Pen",
|
||||
GDK_SOURCE_PEN);
|
||||
break;
|
||||
case GDK_SOURCE_CURSOR:
|
||||
device = create_core_device (device_manager,
|
||||
"Quartz Cursor",
|
||||
GDK_SOURCE_CURSOR);
|
||||
break;
|
||||
case GDK_SOURCE_ERASER:
|
||||
device = create_core_device (device_manager,
|
||||
"Quartz Eraser",
|
||||
GDK_SOURCE_ERASER);
|
||||
break;
|
||||
default:
|
||||
g_warning ("GDK Quarz unknown input source: %i", input_source);
|
||||
break;
|
||||
}
|
||||
|
||||
_gdk_device_set_associated_device (GDK_DEVICE (device), self->core_pointer);
|
||||
_gdk_device_add_slave (self->core_pointer, GDK_DEVICE (device));
|
||||
|
||||
seat = gdk_device_get_seat (self->core_pointer);
|
||||
gdk_seat_default_add_slave (GDK_SEAT_DEFAULT (seat), device);
|
||||
|
||||
_gdk_quartz_device_core_set_unique (device, [nsevent uniqueID]);
|
||||
_gdk_quartz_device_core_set_active (device, TRUE, [nsevent deviceID]);
|
||||
|
||||
self->known_tablet_devices = g_list_append (self->known_tablet_devices,
|
||||
device);
|
||||
|
||||
if ([nsevent isEnteringProximity])
|
||||
{
|
||||
if (!_gdk_quartz_device_core_is_active (device, [nsevent deviceID]))
|
||||
self->num_active_devices++;
|
||||
_gdk_quartz_device_core_set_active (device, TRUE, [nsevent deviceID]);
|
||||
}
|
||||
}
|
||||
|
||||
translate_device_axes (device, [nsevent isEnteringProximity]);
|
||||
|
||||
if (self->num_active_devices)
|
||||
[NSEvent setMouseCoalescingEnabled: FALSE];
|
||||
else
|
||||
[NSEvent setMouseCoalescingEnabled: TRUE];
|
||||
}
|
||||
|
||||
GdkDevice *
|
||||
_gdk_quartz_device_manager_core_device_for_ns_event (GdkDeviceManager *device_manager,
|
||||
NSEvent *nsevent)
|
||||
{
|
||||
GdkQuartzDeviceManagerCore *self = GDK_QUARTZ_DEVICE_MANAGER_CORE (device_manager);
|
||||
GdkDevice *device = NULL;
|
||||
|
||||
if ([nsevent type] == GDK_QUARTZ_EVENT_TABLET_PROXIMITY ||
|
||||
[nsevent subtype] == GDK_QUARTZ_EVENT_SUBTYPE_TABLET_PROXIMITY ||
|
||||
[nsevent subtype] == GDK_QUARTZ_EVENT_SUBTYPE_TABLET_POINT)
|
||||
{
|
||||
/* Find the device based on deviceID */
|
||||
GList *l = NULL;
|
||||
|
||||
for (l = self->known_tablet_devices; l && !device; l = g_list_next (l))
|
||||
{
|
||||
GdkDevice *device_to_check = GDK_DEVICE (l->data);
|
||||
|
||||
if (_gdk_quartz_device_core_is_active (device_to_check, [nsevent deviceID]))
|
||||
device = device_to_check;
|
||||
}
|
||||
}
|
||||
|
||||
if (!device)
|
||||
device = self->core_pointer;
|
||||
|
||||
return device;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <gdkdevicemanagerprivate.h>
|
||||
#include "gdkquartzdevicemanager-core.h"
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
struct _GdkQuartzDeviceManagerCore
|
||||
@@ -30,6 +32,8 @@ struct _GdkQuartzDeviceManagerCore
|
||||
GdkDeviceManager parent_object;
|
||||
GdkDevice *core_pointer;
|
||||
GdkDevice *core_keyboard;
|
||||
GList *known_tablet_devices;
|
||||
guint num_active_devices;
|
||||
};
|
||||
|
||||
struct _GdkQuartzDeviceManagerCoreClass
|
||||
@@ -37,6 +41,12 @@ struct _GdkQuartzDeviceManagerCoreClass
|
||||
GdkDeviceManagerClass parent_class;
|
||||
};
|
||||
|
||||
void _gdk_quartz_device_manager_register_device_for_ns_event (GdkDeviceManager *device_manager,
|
||||
NSEvent *nsevent);
|
||||
|
||||
GdkDevice *_gdk_quartz_device_manager_core_device_for_ns_event (GdkDeviceManager *device_manager,
|
||||
NSEvent *ns_event);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_QUARTZ_DEVICE_MANAGER__ */
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#define GRIP_WIDTH 15
|
||||
#define GRIP_HEIGHT 15
|
||||
#define GDK_LION_RESIZE 5
|
||||
#define TABLET_AXES 5
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
|
||||
#define NSEventTypeRotate 13
|
||||
@@ -173,7 +174,7 @@ gdk_event_apply_filters (NSEvent *nsevent,
|
||||
{
|
||||
GList *tmp_list;
|
||||
GdkFilterReturn result;
|
||||
|
||||
|
||||
tmp_list = *filters;
|
||||
|
||||
while (tmp_list)
|
||||
@@ -557,7 +558,7 @@ generate_motion_event (GdkWindow *window)
|
||||
event->motion.state = _gdk_quartz_events_get_current_keyboard_modifiers () |
|
||||
_gdk_quartz_events_get_current_mouse_modifiers ();
|
||||
event->motion.is_hint = FALSE;
|
||||
event->motion.device = gdk_seat_get_pointer (seat);
|
||||
gdk_event_set_device (event, gdk_seat_get_pointer (seat));
|
||||
gdk_event_set_seat (event, seat);
|
||||
|
||||
append_event (event, TRUE);
|
||||
@@ -643,8 +644,9 @@ find_toplevel_under_pointer (GdkDisplay *display,
|
||||
if (!(toplevel && WINDOW_IS_TOPLEVEL (toplevel)))
|
||||
{
|
||||
gint gdk_x = 0, gdk_y = 0;
|
||||
GdkDevice *pointer = gdk_seat_get_pointer(seat);
|
||||
_gdk_quartz_window_nspoint_to_gdk_xy (screen_point, &gdk_x, &gdk_y);
|
||||
toplevel = gdk_display_get_window_at_pointer (display, &gdk_x, &gdk_y);
|
||||
toplevel = gdk_device_get_window_at_position (pointer, &gdk_x, &gdk_y);
|
||||
|
||||
if (toplevel && ! WINDOW_IS_TOPLEVEL (toplevel))
|
||||
toplevel = gdk_window_get_toplevel (toplevel);
|
||||
@@ -1019,6 +1021,8 @@ fill_button_event (GdkWindow *window,
|
||||
gint y_root)
|
||||
{
|
||||
GdkEventType type;
|
||||
GdkDevice *event_device = NULL;
|
||||
gdouble *axes = NULL;
|
||||
gint state;
|
||||
GdkSeat *seat = gdk_display_get_default_seat (_gdk_display);
|
||||
|
||||
@@ -1045,6 +1049,20 @@ fill_button_event (GdkWindow *window,
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
event_device = _gdk_quartz_device_manager_core_device_for_ns_event (gdk_display_get_device_manager (_gdk_display),
|
||||
nsevent);
|
||||
|
||||
if ([nsevent subtype] == GDK_QUARTZ_EVENT_SUBTYPE_TABLET_POINT)
|
||||
{
|
||||
axes = g_new (gdouble, TABLET_AXES);
|
||||
|
||||
axes[0] = x;
|
||||
axes[1] = y;
|
||||
axes[2] = [nsevent pressure];
|
||||
axes[3] = [nsevent tilt].x;
|
||||
axes[4] = [nsevent tilt].y;
|
||||
}
|
||||
|
||||
event->any.type = type;
|
||||
event->button.window = window;
|
||||
event->button.time = get_time_from_ns_event (nsevent);
|
||||
@@ -1052,11 +1070,12 @@ fill_button_event (GdkWindow *window,
|
||||
event->button.y = y;
|
||||
event->button.x_root = x_root;
|
||||
event->button.y_root = y_root;
|
||||
/* FIXME event->axes */
|
||||
event->button.axes = axes;
|
||||
event->button.state = state;
|
||||
event->button.button = get_mouse_button_from_ns_event (nsevent);
|
||||
|
||||
event->button.device = gdk_seat_get_pointer (seat);
|
||||
gdk_event_set_device (event, gdk_seat_get_pointer (seat));
|
||||
gdk_event_set_source_device (event, event_device);
|
||||
gdk_event_set_seat (event, seat);
|
||||
}
|
||||
|
||||
@@ -1070,6 +1089,22 @@ fill_motion_event (GdkWindow *window,
|
||||
gint y_root)
|
||||
{
|
||||
GdkSeat *seat = gdk_display_get_default_seat (_gdk_display);
|
||||
GdkDevice *event_device = NULL;
|
||||
gdouble *axes = NULL;
|
||||
|
||||
event_device = _gdk_quartz_device_manager_core_device_for_ns_event (gdk_display_get_device_manager (_gdk_display),
|
||||
nsevent);
|
||||
|
||||
if ([nsevent subtype] == GDK_QUARTZ_EVENT_SUBTYPE_TABLET_POINT)
|
||||
{
|
||||
axes = g_new (gdouble, TABLET_AXES);
|
||||
|
||||
axes[0] = x;
|
||||
axes[1] = y;
|
||||
axes[2] = [nsevent pressure];
|
||||
axes[3] = [nsevent tilt].x;
|
||||
axes[4] = [nsevent tilt].y;
|
||||
}
|
||||
|
||||
event->any.type = GDK_MOTION_NOTIFY;
|
||||
event->motion.window = window;
|
||||
@@ -1078,11 +1113,13 @@ fill_motion_event (GdkWindow *window,
|
||||
event->motion.y = y;
|
||||
event->motion.x_root = x_root;
|
||||
event->motion.y_root = y_root;
|
||||
/* FIXME event->axes */
|
||||
event->motion.axes = axes;
|
||||
event->motion.state = get_keyboard_modifiers_from_ns_event (nsevent) |
|
||||
_gdk_quartz_events_get_current_mouse_modifiers ();
|
||||
event->motion.is_hint = FALSE;
|
||||
event->motion.device = gdk_seat_get_pointer (seat);
|
||||
gdk_event_set_device (event, gdk_seat_get_pointer (seat));
|
||||
gdk_event_set_source_device (event, event_device);
|
||||
|
||||
gdk_event_set_seat (event, seat);
|
||||
}
|
||||
|
||||
@@ -1112,9 +1149,9 @@ fill_scroll_event (GdkWindow *window,
|
||||
event->scroll.y_root = y_root;
|
||||
event->scroll.state = get_keyboard_modifiers_from_ns_event (nsevent);
|
||||
event->scroll.direction = direction;
|
||||
event->scroll.device = gdk_seat_get_pointer (seat);
|
||||
event->scroll.delta_x = delta_x;
|
||||
event->scroll.delta_y = delta_y;
|
||||
gdk_event_set_device (event, gdk_seat_get_pointer (seat));
|
||||
gdk_event_set_seat (event, seat);
|
||||
}
|
||||
|
||||
@@ -1343,16 +1380,18 @@ _gdk_quartz_events_get_current_keyboard_modifiers (void)
|
||||
GdkModifierType
|
||||
_gdk_quartz_events_get_current_mouse_modifiers (void)
|
||||
{
|
||||
NSUInteger buttons = 0;
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
|
||||
if (gdk_quartz_osx_version () >= GDK_OSX_SNOW_LEOPARD)
|
||||
return get_mouse_button_modifiers_from_ns_buttons ([NSClassFromString(@"NSEvent") pressedMouseButtons]);
|
||||
buttons = [NSClassFromString(@"NSEvent") pressedMouseButtons];
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
||||
return get_mouse_button_modifiers_from_ns_buttons (GetCurrentButtonState ());
|
||||
buttons = GetCurrentButtonState ();
|
||||
#endif
|
||||
return get_mouse_button_modifiers_from_ns_buttons (buttons);
|
||||
}
|
||||
|
||||
/* Detect window resizing */
|
||||
@@ -1470,6 +1509,15 @@ gdk_event_translate (GdkEvent *event,
|
||||
}
|
||||
}
|
||||
|
||||
/* We need to register the proximity event from any point on the screen
|
||||
* to properly register the devices
|
||||
*/
|
||||
if (event_type == GDK_QUARTZ_EVENT_TABLET_PROXIMITY)
|
||||
{
|
||||
_gdk_quartz_device_manager_register_device_for_ns_event (gdk_display_get_device_manager (_gdk_display),
|
||||
nsevent);
|
||||
}
|
||||
|
||||
nswindow = [nsevent window];
|
||||
|
||||
/* Ignore events for windows not created by GDK. */
|
||||
|
||||
@@ -42,6 +42,8 @@ gdk_quartz_osx_version (void)
|
||||
|
||||
version = [[NSProcessInfo processInfo] operatingSystemVersion];
|
||||
minor = version.minorVersion;
|
||||
if (version.majorVersion == 11)
|
||||
minor += 16;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -75,6 +75,16 @@ typedef enum {
|
||||
GDK_QUARTZ_EVENT_SUBTYPE_EVENTLOOP
|
||||
} GdkQuartzEventSubType;
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 10130
|
||||
#define GDK_QUARTZ_EVENT_TABLET_PROXIMITY NSEventTypeTabletProximity
|
||||
#define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_PROXIMITY NSEventSubtypeTabletProximity
|
||||
#define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_POINT NSEventSubtypeTabletPoint
|
||||
#else
|
||||
#define GDK_QUARTZ_EVENT_TABLET_PROXIMITY NSTabletProximity
|
||||
#define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_PROXIMITY NSTabletProximityEventSubtype
|
||||
#define GDK_QUARTZ_EVENT_SUBTYPE_TABLET_POINT NSTabletPointEventSubtype
|
||||
#endif
|
||||
|
||||
void _gdk_quartz_events_update_focus_window (GdkWindow *new_window,
|
||||
gboolean got_focus);
|
||||
void _gdk_quartz_events_send_map_event (GdkWindow *window);
|
||||
@@ -84,6 +94,19 @@ GdkModifierType _gdk_quartz_events_get_current_mouse_modifiers (void);
|
||||
|
||||
void _gdk_quartz_events_break_all_grabs (guint32 time);
|
||||
|
||||
/* Devices */
|
||||
void _gdk_quartz_device_core_set_active (GdkDevice *device,
|
||||
gboolean active,
|
||||
NSUInteger device_id);
|
||||
|
||||
gboolean _gdk_quartz_device_core_is_active (GdkDevice *device,
|
||||
NSUInteger device_id);
|
||||
|
||||
void _gdk_quartz_device_core_set_unique (GdkDevice *device,
|
||||
unsigned long long unique_id);
|
||||
|
||||
unsigned long long _gdk_quartz_device_core_get_unique (GdkDevice *device);
|
||||
|
||||
/* Event loop */
|
||||
gboolean _gdk_quartz_event_loop_check_pending (void);
|
||||
NSEvent * _gdk_quartz_event_loop_get_pending (void);
|
||||
|
||||
@@ -40,7 +40,9 @@ typedef enum
|
||||
GDK_OSX_SIERRA = 12,
|
||||
GDK_OSX_HIGH_SIERRA = 13,
|
||||
GDK_OSX_MOJAVE = 14,
|
||||
GDK_OSX_CURRENT = 14,
|
||||
GDK_OSX_CATALINA = 15,
|
||||
GDK_OSX_BIGSUR = 16,
|
||||
GDK_OSX_CURRENT = 15,
|
||||
GDK_OSX_NEW = 99
|
||||
} GdkOSXVersion;
|
||||
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
/* GdkScreen is deprecated, but we need to support it still so silence the warnings.*/
|
||||
#define GDK_DISABLE_DEPRECATION_WARNINGS 1
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
#include "gdkprivate-quartz.h"
|
||||
@@ -121,9 +122,6 @@ static void
|
||||
gdk_quartz_screen_calculate_layout (GdkQuartzScreen *screen,
|
||||
GdkQuartzDisplay *display)
|
||||
{
|
||||
int i, monitors;
|
||||
int max_x, max_y;
|
||||
|
||||
if (!display)
|
||||
display = GDK_QUARTZ_DISPLAY (gdk_screen_get_display (GDK_SCREEN (screen)));
|
||||
|
||||
|
||||
@@ -743,15 +743,38 @@ _gdk_quartz_window_find_child (GdkWindow *window,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Raises a transient window.
|
||||
*/
|
||||
static void
|
||||
raise_transient (GdkWindowImplQuartz *impl)
|
||||
{
|
||||
/* In quartz the transient-for behavior is implemented by
|
||||
* attaching the transient-for GdkNSWindows to the parent's
|
||||
* GdkNSWindow. Stacking is managed by Quartz and the order
|
||||
* is that of the parent's childWindows array. The only way
|
||||
* to change that order is to remove the child from the
|
||||
* parent and then add it back in.
|
||||
*/
|
||||
GdkWindowImplQuartz *parent_impl =
|
||||
GDK_WINDOW_IMPL_QUARTZ (impl->transient_for->impl);
|
||||
[parent_impl->toplevel removeChildWindow:impl->toplevel];
|
||||
[parent_impl->toplevel addChildWindow:impl->toplevel
|
||||
ordered:NSWindowAbove];
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_quartz_window_did_become_main (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
|
||||
|
||||
main_window_stack = g_slist_remove (main_window_stack, window);
|
||||
|
||||
if (window->window_type != GDK_WINDOW_TEMP)
|
||||
main_window_stack = g_slist_prepend (main_window_stack, window);
|
||||
|
||||
if (impl->transient_for)
|
||||
raise_transient (impl);
|
||||
|
||||
clear_toplevel_order ();
|
||||
}
|
||||
|
||||
@@ -824,6 +847,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
|
||||
{
|
||||
GdkWindowImplQuartz *impl;
|
||||
GdkWindowImplQuartz *parent_impl;
|
||||
GdkWindowTypeHint type_hint = GDK_WINDOW_TYPE_HINT_NORMAL;
|
||||
|
||||
GDK_QUARTZ_ALLOC_POOL;
|
||||
|
||||
@@ -856,6 +880,12 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
|
||||
|
||||
impl->view = NULL;
|
||||
|
||||
if (attributes_mask & GDK_WA_TYPE_HINT)
|
||||
{
|
||||
type_hint = attributes->type_hint;
|
||||
gdk_window_set_type_hint (window, type_hint);
|
||||
}
|
||||
|
||||
switch (window->window_type)
|
||||
{
|
||||
case GDK_WINDOW_TOPLEVEL:
|
||||
@@ -885,8 +915,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
|
||||
window->height);
|
||||
|
||||
if (window->window_type == GDK_WINDOW_TEMP ||
|
||||
((attributes_mask & GDK_WA_TYPE_HINT) &&
|
||||
attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN))
|
||||
type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN)
|
||||
{
|
||||
style_mask = GDK_QUARTZ_BORDERLESS_WINDOW;
|
||||
}
|
||||
@@ -904,6 +933,9 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
|
||||
defer:NO
|
||||
screen:screen];
|
||||
|
||||
if (type_hint != GDK_WINDOW_TYPE_HINT_NORMAL)
|
||||
impl->toplevel.excludedFromWindowsMenu = true;
|
||||
|
||||
if (attributes_mask & GDK_WA_TITLE)
|
||||
title = attributes->title;
|
||||
else
|
||||
@@ -959,9 +991,6 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
|
||||
}
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
|
||||
if (attributes_mask & GDK_WA_TYPE_HINT)
|
||||
gdk_window_set_type_hint (window, attributes->type_hint);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1510,7 +1539,11 @@ gdk_window_quartz_raise (GdkWindow *window)
|
||||
GdkWindowImplQuartz *impl;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
|
||||
[impl->toplevel orderFront:impl->toplevel];
|
||||
|
||||
if (impl->transient_for)
|
||||
raise_transient (impl);
|
||||
else
|
||||
[impl->toplevel orderFront:impl->toplevel];
|
||||
|
||||
clear_toplevel_order ();
|
||||
}
|
||||
|
||||
@@ -40,7 +40,9 @@ BUILT_SOURCES = \
|
||||
server-decoration-client-protocol.h \
|
||||
server-decoration-protocol.c \
|
||||
gtk-shell-client-protocol.h \
|
||||
gtk-shell-protocol.c
|
||||
gtk-shell-protocol.c \
|
||||
primary-selection-unstable-v1-client-protocol.h \
|
||||
primary-selection-unstable-v1-protocol.c
|
||||
|
||||
nodist_libgdk_wayland_la_SOURCES = \
|
||||
$(BUILT_SOURCES)
|
||||
|
||||
@@ -237,7 +237,8 @@ struct _GdkWaylandSeat
|
||||
uint32_t keyboard_time;
|
||||
uint32_t keyboard_key_serial;
|
||||
|
||||
struct gtk_primary_selection_device *primary_data_device;
|
||||
struct gtk_primary_selection_device *gtk_primary_data_device;
|
||||
struct zwp_primary_selection_device_v1 *zwp_primary_data_device_v1;
|
||||
struct wl_data_device *data_device;
|
||||
GdkDragContext *drop_context;
|
||||
|
||||
@@ -1308,23 +1309,43 @@ static const struct wl_data_device_listener data_device_listener = {
|
||||
};
|
||||
|
||||
static void
|
||||
primary_selection_data_offer (void *data,
|
||||
struct gtk_primary_selection_device *gtk_primary_selection_device,
|
||||
struct gtk_primary_selection_offer *gtk_primary_offer)
|
||||
primary_selection_data_offer (void *data,
|
||||
gpointer primary_selection_device,
|
||||
gpointer primary_offer)
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("primary selection offer, device %p, data offer %p",
|
||||
gtk_primary_selection_device, gtk_primary_offer));
|
||||
primary_selection_device, primary_offer));
|
||||
|
||||
gdk_wayland_selection_ensure_primary_offer (seat->display, gtk_primary_offer);
|
||||
gdk_wayland_selection_ensure_primary_offer (seat->display, primary_offer);
|
||||
}
|
||||
|
||||
static void
|
||||
primary_selection_selection (void *data,
|
||||
struct gtk_primary_selection_device *gtk_primary_selection_device,
|
||||
struct gtk_primary_selection_offer *gtk_primary_offer)
|
||||
gtk_primary_selection_data_offer (void *data,
|
||||
struct gtk_primary_selection_device *primary_selection_device,
|
||||
struct gtk_primary_selection_offer *primary_offer)
|
||||
{
|
||||
primary_selection_data_offer (data,
|
||||
(gpointer) primary_selection_device,
|
||||
(gpointer) primary_offer);
|
||||
}
|
||||
|
||||
static void
|
||||
zwp_primary_selection_v1_data_offer (void *data,
|
||||
struct zwp_primary_selection_device_v1 *primary_selection_device,
|
||||
struct zwp_primary_selection_offer_v1 *primary_offer)
|
||||
{
|
||||
primary_selection_data_offer (data,
|
||||
(gpointer) primary_selection_device,
|
||||
(gpointer) primary_offer);
|
||||
}
|
||||
|
||||
static void
|
||||
primary_selection_selection (void *data,
|
||||
gpointer primary_selection_device,
|
||||
gpointer primary_offer)
|
||||
{
|
||||
GdkWaylandSeat *seat = data;
|
||||
GdkAtom selection;
|
||||
@@ -1334,16 +1355,41 @@ primary_selection_selection (void *data,
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("primary selection selection, device %p, data offer %p",
|
||||
gtk_primary_selection_device, gtk_primary_offer));
|
||||
primary_selection_device, primary_offer));
|
||||
|
||||
selection = gdk_atom_intern_static_string ("PRIMARY");
|
||||
gdk_wayland_selection_set_offer (seat->display, selection, gtk_primary_offer);
|
||||
gdk_wayland_selection_set_offer (seat->display, selection, primary_offer);
|
||||
emit_selection_owner_change (seat->keyboard_focus, selection);
|
||||
}
|
||||
|
||||
static const struct gtk_primary_selection_device_listener primary_selection_device_listener = {
|
||||
primary_selection_data_offer,
|
||||
primary_selection_selection,
|
||||
static void
|
||||
gtk_primary_selection_selection (void *data,
|
||||
struct gtk_primary_selection_device *primary_selection_device,
|
||||
struct gtk_primary_selection_offer *primary_offer)
|
||||
{
|
||||
primary_selection_selection (data,
|
||||
(gpointer) primary_selection_device,
|
||||
(gpointer) primary_offer);
|
||||
}
|
||||
|
||||
static void
|
||||
zwp_primary_selection_v1_selection (void *data,
|
||||
struct zwp_primary_selection_device_v1 *primary_selection_device,
|
||||
struct zwp_primary_selection_offer_v1 *primary_offer)
|
||||
{
|
||||
primary_selection_selection (data,
|
||||
(gpointer) primary_selection_device,
|
||||
(gpointer) primary_offer);
|
||||
}
|
||||
|
||||
static const struct gtk_primary_selection_device_listener gtk_primary_device_listener = {
|
||||
gtk_primary_selection_data_offer,
|
||||
gtk_primary_selection_selection,
|
||||
};
|
||||
|
||||
static const struct zwp_primary_selection_device_v1_listener zwp_primary_device_v1_listener = {
|
||||
zwp_primary_selection_v1_data_offer,
|
||||
zwp_primary_selection_v1_selection,
|
||||
};
|
||||
|
||||
static GdkDevice * get_scroll_device (GdkWaylandSeat *seat,
|
||||
@@ -2460,6 +2506,9 @@ touch_handle_down (void *data,
|
||||
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
if (!wl_surface)
|
||||
return;
|
||||
|
||||
touch = gdk_wayland_seat_add_touch (seat, id, wl_surface);
|
||||
touch->x = wl_fixed_to_double (x);
|
||||
touch->y = wl_fixed_to_double (y);
|
||||
@@ -2495,6 +2544,9 @@ touch_handle_up (void *data,
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
touch = gdk_wayland_seat_get_touch (seat, id);
|
||||
if (!touch)
|
||||
return;
|
||||
|
||||
event = _create_touch_event (seat, touch, GDK_TOUCH_END, time);
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
@@ -2521,6 +2573,9 @@ touch_handle_motion (void *data,
|
||||
GdkEvent *event;
|
||||
|
||||
touch = gdk_wayland_seat_get_touch (seat, id);
|
||||
if (!touch)
|
||||
return;
|
||||
|
||||
touch->x = wl_fixed_to_double (x);
|
||||
touch->y = wl_fixed_to_double (y);
|
||||
|
||||
@@ -2816,6 +2871,14 @@ _gdk_wayland_seat_remove_tablet (GdkWaylandSeat *seat,
|
||||
|
||||
zwp_tablet_v2_destroy (tablet->wp_tablet);
|
||||
|
||||
while (tablet->pads)
|
||||
{
|
||||
GdkWaylandTabletPadData *pad = tablet->pads->data;
|
||||
|
||||
pad->current_tablet = NULL;
|
||||
tablet->pads = g_list_remove (tablet->pads, pad);
|
||||
}
|
||||
|
||||
device_manager->devices =
|
||||
g_list_remove (device_manager->devices, tablet->master);
|
||||
device_manager->devices =
|
||||
@@ -3626,19 +3689,21 @@ tablet_tool_handle_proximity_in (void *data,
|
||||
struct zwp_tablet_tool_v2 *wp_tablet_tool,
|
||||
uint32_t serial,
|
||||
struct zwp_tablet_v2 *wp_tablet,
|
||||
struct wl_surface *surface)
|
||||
struct wl_surface *wl_surface)
|
||||
{
|
||||
GdkWaylandTabletToolData *tool = data;
|
||||
GdkWaylandTabletData *tablet = zwp_tablet_v2_get_user_data (wp_tablet);
|
||||
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkWindow *window = wl_surface_get_user_data (surface);
|
||||
GdkWindow *window;
|
||||
GdkEvent *event;
|
||||
|
||||
if (!surface)
|
||||
return;
|
||||
if (!wl_surface)
|
||||
return;
|
||||
|
||||
window = wl_surface_get_user_data (wl_surface);
|
||||
if (!GDK_IS_WINDOW (window))
|
||||
return;
|
||||
return;
|
||||
|
||||
tool->current_tablet = tablet;
|
||||
tablet->current_tool = tool;
|
||||
@@ -3677,6 +3742,9 @@ tablet_tool_handle_proximity_out (void *data,
|
||||
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tool->seat);
|
||||
#endif
|
||||
|
||||
if (!tablet)
|
||||
return;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("proximity out, seat %p, tool %d", seat,
|
||||
gdk_device_tool_get_tool_type (tool->tool)));
|
||||
@@ -3733,7 +3801,7 @@ tablet_tool_handle_down (void *data,
|
||||
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tool->seat);
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
|
||||
if (!tablet->pointer_info.focus)
|
||||
if (!tablet || !tablet->pointer_info.focus)
|
||||
return;
|
||||
|
||||
_gdk_wayland_display_update_serial (display_wayland, serial);
|
||||
@@ -3750,7 +3818,7 @@ tablet_tool_handle_up (void *data,
|
||||
GdkWaylandTabletToolData *tool = data;
|
||||
GdkWaylandTabletData *tablet = tool->current_tablet;
|
||||
|
||||
if (!tablet->pointer_info.focus)
|
||||
if (!tablet || !tablet->pointer_info.focus)
|
||||
return;
|
||||
|
||||
tablet_create_button_event_frame (tablet, GDK_BUTTON_RELEASE, GDK_BUTTON_PRIMARY);
|
||||
@@ -3769,6 +3837,9 @@ tablet_tool_handle_motion (void *data,
|
||||
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (seat->display);
|
||||
GdkEvent *event;
|
||||
|
||||
if (!tablet)
|
||||
return;
|
||||
|
||||
tablet->pointer_info.surface_x = wl_fixed_to_double (sx);
|
||||
tablet->pointer_info.surface_y = wl_fixed_to_double (sy);
|
||||
|
||||
@@ -3801,7 +3872,12 @@ tablet_tool_handle_pressure (void *data,
|
||||
{
|
||||
GdkWaylandTabletToolData *tool = data;
|
||||
GdkWaylandTabletData *tablet = tool->current_tablet;
|
||||
gint axis_index = tablet->axis_indices[GDK_AXIS_PRESSURE];
|
||||
gint axis_index;
|
||||
|
||||
if (!tablet)
|
||||
return;
|
||||
|
||||
axis_index = tablet->axis_indices[GDK_AXIS_PRESSURE];
|
||||
|
||||
_gdk_device_translate_axis (tablet->current_device, axis_index,
|
||||
pressure, &tablet->axes[axis_index]);
|
||||
@@ -3818,7 +3894,12 @@ tablet_tool_handle_distance (void *data,
|
||||
{
|
||||
GdkWaylandTabletToolData *tool = data;
|
||||
GdkWaylandTabletData *tablet = tool->current_tablet;
|
||||
gint axis_index = tablet->axis_indices[GDK_AXIS_DISTANCE];
|
||||
gint axis_index;
|
||||
|
||||
if (!tablet)
|
||||
return;
|
||||
|
||||
axis_index = tablet->axis_indices[GDK_AXIS_DISTANCE];
|
||||
|
||||
_gdk_device_translate_axis (tablet->current_device, axis_index,
|
||||
distance, &tablet->axes[axis_index]);
|
||||
@@ -3836,8 +3917,14 @@ tablet_tool_handle_tilt (void *data,
|
||||
{
|
||||
GdkWaylandTabletToolData *tool = data;
|
||||
GdkWaylandTabletData *tablet = tool->current_tablet;
|
||||
gint xtilt_axis_index = tablet->axis_indices[GDK_AXIS_XTILT];
|
||||
gint ytilt_axis_index = tablet->axis_indices[GDK_AXIS_YTILT];
|
||||
gint xtilt_axis_index;
|
||||
gint ytilt_axis_index;
|
||||
|
||||
if (!tablet)
|
||||
return;
|
||||
|
||||
xtilt_axis_index = tablet->axis_indices[GDK_AXIS_XTILT];
|
||||
ytilt_axis_index = tablet->axis_indices[GDK_AXIS_YTILT];
|
||||
|
||||
_gdk_device_translate_axis (tablet->current_device, xtilt_axis_index,
|
||||
wl_fixed_to_double (xtilt),
|
||||
@@ -3864,7 +3951,7 @@ tablet_tool_handle_button (void *data,
|
||||
GdkEventType evtype;
|
||||
guint n_button;
|
||||
|
||||
if (!tablet->pointer_info.focus)
|
||||
if (!tablet || !tablet->pointer_info.focus)
|
||||
return;
|
||||
|
||||
tablet->pointer_info.press_serial = serial;
|
||||
@@ -3895,7 +3982,12 @@ tablet_tool_handle_rotation (void *data,
|
||||
{
|
||||
GdkWaylandTabletToolData *tool = data;
|
||||
GdkWaylandTabletData *tablet = tool->current_tablet;
|
||||
gint axis_index = tablet->axis_indices[GDK_AXIS_ROTATION];
|
||||
gint axis_index;
|
||||
|
||||
if (!tablet)
|
||||
return;
|
||||
|
||||
axis_index = tablet->axis_indices[GDK_AXIS_ROTATION];
|
||||
|
||||
_gdk_device_translate_axis (tablet->current_device, axis_index,
|
||||
wl_fixed_to_double (degrees),
|
||||
@@ -3914,7 +4006,12 @@ tablet_tool_handle_slider (void *data,
|
||||
{
|
||||
GdkWaylandTabletToolData *tool = data;
|
||||
GdkWaylandTabletData *tablet = tool->current_tablet;
|
||||
gint axis_index = tablet->axis_indices[GDK_AXIS_SLIDER];
|
||||
gint axis_index;
|
||||
|
||||
if (!tablet)
|
||||
return;
|
||||
|
||||
axis_index = tablet->axis_indices[GDK_AXIS_SLIDER];
|
||||
|
||||
_gdk_device_translate_axis (tablet->current_device, axis_index,
|
||||
position, &tablet->axes[axis_index]);
|
||||
@@ -3932,9 +4029,12 @@ tablet_tool_handle_wheel (void *data,
|
||||
{
|
||||
GdkWaylandTabletToolData *tool = data;
|
||||
GdkWaylandTabletData *tablet = tool->current_tablet;
|
||||
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
|
||||
GdkWaylandSeat *seat;
|
||||
GdkEvent *event;
|
||||
|
||||
if (!tablet)
|
||||
return;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("tablet tool %d wheel %d/%d",
|
||||
gdk_device_tool_get_tool_type (tool->tool), degrees, clicks));
|
||||
@@ -3942,6 +4042,8 @@ tablet_tool_handle_wheel (void *data,
|
||||
if (clicks == 0)
|
||||
return;
|
||||
|
||||
seat = GDK_WAYLAND_SEAT (tablet->seat);
|
||||
|
||||
/* Send smooth event */
|
||||
event = create_scroll_event (seat, &tablet->pointer_info,
|
||||
tablet->master, tablet->current_device, FALSE);
|
||||
@@ -3967,6 +4069,9 @@ tablet_tool_handle_frame (void *data,
|
||||
GdkWaylandTabletData *tablet = tool->current_tablet;
|
||||
GdkEvent *frame_event;
|
||||
|
||||
if (!tablet)
|
||||
return;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("tablet frame, time %d", time));
|
||||
|
||||
@@ -4590,6 +4695,9 @@ pointer_surface_update_scale (GdkDevice *device)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!pointer->pointer_surface_outputs)
|
||||
return;
|
||||
|
||||
scale = 1;
|
||||
for (l = pointer->pointer_surface_outputs; l != NULL; l = l->next)
|
||||
{
|
||||
@@ -4599,6 +4707,8 @@ pointer_surface_update_scale (GdkDevice *device)
|
||||
scale = MAX (scale, output_scale);
|
||||
}
|
||||
|
||||
if (pointer->current_output_scale == scale)
|
||||
return;
|
||||
pointer->current_output_scale = scale;
|
||||
|
||||
if (pointer->cursor)
|
||||
@@ -5070,13 +5180,23 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
|
||||
wl_seat_add_listener (seat->wl_seat, &seat_listener, seat);
|
||||
wl_seat_set_user_data (seat->wl_seat, seat);
|
||||
|
||||
if (display_wayland->primary_selection_manager)
|
||||
if (display_wayland->zwp_primary_selection_manager_v1)
|
||||
{
|
||||
seat->primary_data_device =
|
||||
gtk_primary_selection_device_manager_get_device (display_wayland->primary_selection_manager,
|
||||
seat->zwp_primary_data_device_v1 =
|
||||
zwp_primary_selection_device_manager_v1_get_device (display_wayland->zwp_primary_selection_manager_v1,
|
||||
seat->wl_seat);
|
||||
zwp_primary_selection_device_v1_add_listener (seat->zwp_primary_data_device_v1,
|
||||
&zwp_primary_device_v1_listener,
|
||||
seat);
|
||||
}
|
||||
else if (display_wayland->gtk_primary_selection_manager)
|
||||
{
|
||||
seat->gtk_primary_data_device =
|
||||
gtk_primary_selection_device_manager_get_device (display_wayland->gtk_primary_selection_manager,
|
||||
seat->wl_seat);
|
||||
gtk_primary_selection_device_add_listener (seat->primary_data_device,
|
||||
&primary_selection_device_listener, seat);
|
||||
gtk_primary_selection_device_add_listener (seat->gtk_primary_data_device,
|
||||
>k_primary_device_listener,
|
||||
seat);
|
||||
}
|
||||
|
||||
seat->data_device =
|
||||
@@ -5347,8 +5467,8 @@ gdk_wayland_seat_set_selection (GdkSeat *seat,
|
||||
}
|
||||
|
||||
void
|
||||
gdk_wayland_seat_set_primary (GdkSeat *seat,
|
||||
struct gtk_primary_selection_source *source)
|
||||
gdk_wayland_seat_set_primary (GdkSeat *seat,
|
||||
gpointer source)
|
||||
{
|
||||
GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (seat);
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
@@ -5358,8 +5478,16 @@ gdk_wayland_seat_set_primary (GdkSeat *seat,
|
||||
{
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (gdk_seat_get_display (seat));
|
||||
serial = _gdk_wayland_display_get_serial (display_wayland);
|
||||
gtk_primary_selection_device_set_selection (wayland_seat->primary_data_device,
|
||||
source, serial);
|
||||
if (wayland_seat->zwp_primary_data_device_v1)
|
||||
{
|
||||
zwp_primary_selection_device_v1_set_selection (wayland_seat->zwp_primary_data_device_v1,
|
||||
source, serial);
|
||||
}
|
||||
else if (wayland_seat->gtk_primary_data_device)
|
||||
{
|
||||
gtk_primary_selection_device_set_selection (wayland_seat->gtk_primary_data_device,
|
||||
source, serial);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
|
||||
#define MIN_SYSTEM_BELL_DELAY_MS 20
|
||||
|
||||
#define GTK_SHELL1_VERSION 3
|
||||
#define GTK_SHELL1_VERSION 4
|
||||
|
||||
static void _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *display_wayland);
|
||||
|
||||
@@ -476,10 +476,16 @@ gdk_registry_handle_global (void *data,
|
||||
}
|
||||
else if (strcmp (interface, "gtk_primary_selection_device_manager") == 0)
|
||||
{
|
||||
display_wayland->primary_selection_manager =
|
||||
display_wayland->gtk_primary_selection_manager =
|
||||
wl_registry_bind(display_wayland->wl_registry, id,
|
||||
>k_primary_selection_device_manager_interface, 1);
|
||||
}
|
||||
else if (strcmp (interface, "zwp_primary_selection_device_manager_v1") == 0)
|
||||
{
|
||||
display_wayland->zwp_primary_selection_manager_v1 =
|
||||
wl_registry_bind(display_wayland->wl_registry, id,
|
||||
&zwp_primary_selection_device_manager_v1_interface, 1);
|
||||
}
|
||||
else if (strcmp (interface, "zwp_tablet_manager_v2") == 0)
|
||||
{
|
||||
display_wayland->tablet_manager =
|
||||
@@ -729,6 +735,8 @@ gdk_wayland_display_finalize (GObject *object)
|
||||
|
||||
g_ptr_array_free (display_wayland->monitors, TRUE);
|
||||
|
||||
wl_display_disconnect(display_wayland->wl_display);
|
||||
|
||||
G_OBJECT_CLASS (gdk_wayland_display_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <gdk/wayland/keyboard-shortcuts-inhibit-unstable-v1-client-protocol.h>
|
||||
#include <gdk/wayland/server-decoration-client-protocol.h>
|
||||
#include <gdk/wayland/xdg-output-unstable-v1-client-protocol.h>
|
||||
#include <gdk/wayland/primary-selection-unstable-v1-client-protocol.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <gdk/gdkkeys.h>
|
||||
@@ -88,7 +89,8 @@ struct _GdkWaylandDisplay
|
||||
struct wl_data_device_manager *data_device_manager;
|
||||
struct wl_subcompositor *subcompositor;
|
||||
struct zwp_pointer_gestures_v1 *pointer_gestures;
|
||||
struct gtk_primary_selection_device_manager *primary_selection_manager;
|
||||
struct gtk_primary_selection_device_manager *gtk_primary_selection_manager;
|
||||
struct zwp_primary_selection_device_manager_v1 *zwp_primary_selection_manager_v1;
|
||||
struct zwp_tablet_manager_v2 *tablet_manager;
|
||||
struct zxdg_exporter_v1 *xdg_exporter;
|
||||
struct zxdg_importer_v1 *xdg_importer;
|
||||
|
||||
@@ -374,7 +374,7 @@ gdk_wayland_drag_context_set_hotspot (GdkDragContext *context,
|
||||
return;
|
||||
|
||||
_gdk_wayland_window_offset_next_wl_buffer (context_wayland->dnd_window,
|
||||
-hot_x, -hot_y);
|
||||
prev_hot_x - hot_x, prev_hot_y - hot_y);
|
||||
gdk_window_invalidate_rect (context_wayland->dnd_window, &damage_rect, FALSE);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
#include <sys/mman.h>
|
||||
#include <fribidi.h>
|
||||
|
||||
#include "gdk.h"
|
||||
#include "gdkwayland.h"
|
||||
|
||||
@@ -191,8 +191,8 @@ struct wl_data_device * gdk_wayland_device_get_data_device (GdkDevice *gdk_devic
|
||||
void gdk_wayland_seat_set_selection (GdkSeat *seat,
|
||||
struct wl_data_source *source);
|
||||
|
||||
void gdk_wayland_seat_set_primary (GdkSeat *seat,
|
||||
struct gtk_primary_selection_source *source);
|
||||
void gdk_wayland_seat_set_primary (GdkSeat *seat,
|
||||
gpointer source);
|
||||
|
||||
GdkDragContext * gdk_wayland_device_get_drop_context (GdkDevice *gdk_device);
|
||||
|
||||
@@ -249,8 +249,8 @@ void gdk_wayland_selection_free (GdkWaylandSelection *selection);
|
||||
|
||||
void gdk_wayland_selection_ensure_offer (GdkDisplay *display,
|
||||
struct wl_data_offer *wl_offer);
|
||||
void gdk_wayland_selection_ensure_primary_offer (GdkDisplay *display,
|
||||
struct gtk_primary_selection_offer *wp_offer);
|
||||
void gdk_wayland_selection_ensure_primary_offer (GdkDisplay *display,
|
||||
gpointer wp_offer);
|
||||
|
||||
void gdk_wayland_selection_set_offer (GdkDisplay *display,
|
||||
GdkAtom selection,
|
||||
|
||||
@@ -351,25 +351,52 @@ update_xft_settings (GdkScreen *screen)
|
||||
{
|
||||
TranslationEntry *entry;
|
||||
|
||||
entry = find_translation_entry_by_schema ("org.gnome.settings-daemon.plugins.xsettings", "antialiasing");
|
||||
antialiasing = entry->fallback.i;
|
||||
entry = find_translation_entry_by_schema ("org.gnome.desktop.interface", "font-antialiasing");
|
||||
|
||||
entry = find_translation_entry_by_schema ("org.gnome.settings-daemon.plugins.xsettings", "hinting");
|
||||
hinting = entry->fallback.i;
|
||||
if (entry->valid)
|
||||
{
|
||||
antialiasing = entry->fallback.i;
|
||||
|
||||
entry = find_translation_entry_by_schema ("org.gnome.settings-daemon.plugins.xsettings", "rgba-order");
|
||||
order = entry->fallback.i;
|
||||
entry = find_translation_entry_by_schema ("org.gnome.desktop.interface", "font-hinting");
|
||||
hinting = entry->fallback.i;
|
||||
|
||||
entry = find_translation_entry_by_schema ("org.gnome.desktop.interface", "font-rgba-order");
|
||||
order = entry->fallback.i;
|
||||
}
|
||||
else
|
||||
{
|
||||
entry = find_translation_entry_by_schema ("org.gnome.settings-daemon.plugins.xsettings", "antialiasing");
|
||||
antialiasing = entry->fallback.i;
|
||||
|
||||
entry = find_translation_entry_by_schema ("org.gnome.settings-daemon.plugins.xsettings", "hinting");
|
||||
hinting = entry->fallback.i;
|
||||
|
||||
entry = find_translation_entry_by_schema ("org.gnome.settings-daemon.plugins.xsettings", "rgba-order");
|
||||
order = entry->fallback.i;
|
||||
}
|
||||
|
||||
entry = find_translation_entry_by_schema ("org.gnome.desktop.interface", "text-scaling-factor");
|
||||
dpi = 96.0 * entry->fallback.i / 65536.0 * 1024; /* Xft wants 1/1024th of an inch */
|
||||
}
|
||||
else
|
||||
{
|
||||
settings = g_hash_table_lookup (screen_wayland->settings,
|
||||
"org.gnome.settings-daemon.plugins.xsettings");
|
||||
TranslationEntry *entry;
|
||||
|
||||
if (settings)
|
||||
entry = find_translation_entry_by_schema ("org.gnome.desktop.interface", "font-antialiasing");
|
||||
|
||||
if (entry && entry->valid)
|
||||
{
|
||||
settings = g_hash_table_lookup (screen_wayland->settings,
|
||||
"org.gnome.desktop.interface");
|
||||
antialiasing = g_settings_get_enum (settings, "font-antialiasing");
|
||||
hinting = g_settings_get_enum (settings, "font-hinting");
|
||||
order = g_settings_get_enum (settings, "font-rgba-order");
|
||||
}
|
||||
else if (g_hash_table_contains (screen_wayland->settings,
|
||||
"org.gnome.settings-daemon.plugins.xsettings"))
|
||||
{
|
||||
settings = g_hash_table_lookup (screen_wayland->settings,
|
||||
"org.gnome.settings-daemon.plugins.xsettings");
|
||||
antialiasing = g_settings_get_enum (settings, "antialiasing");
|
||||
hinting = g_settings_get_enum (settings, "hinting");
|
||||
order = g_settings_get_enum (settings, "rgba-order");
|
||||
@@ -504,6 +531,8 @@ static TranslationEntry translations[] = {
|
||||
{ FALSE, "org.gnome.desktop.interface", "enable-animations", "gtk-enable-animations", G_TYPE_BOOLEAN, { .b = TRUE } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "gtk-enable-primary-paste", "gtk-enable-primary-paste", G_TYPE_BOOLEAN, { .b = TRUE } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "overlay-scrolling", "gtk-overlay-scrolling", G_TYPE_BOOLEAN, { .b = TRUE } },
|
||||
{ FALSE, "org.gnome.desktop.peripherals.mouse", "double-click", "gtk-double-click-time", G_TYPE_INT, { .i = 400 } },
|
||||
{ FALSE, "org.gnome.desktop.peripherals.mouse", "drag-threshold", "gtk-dnd-drag-threshold", G_TYPE_INT, {.i = 8 } },
|
||||
{ FALSE, "org.gnome.settings-daemon.peripherals.mouse", "double-click", "gtk-double-click-time", G_TYPE_INT, { .i = 400 } },
|
||||
{ FALSE, "org.gnome.settings-daemon.peripherals.mouse", "drag-threshold", "gtk-dnd-drag-threshold", G_TYPE_INT, {.i = 8 } },
|
||||
{ FALSE, "org.gnome.desktop.sound", "theme-name", "gtk-sound-theme-name", G_TYPE_STRING, { .s = "freedesktop" } },
|
||||
@@ -513,6 +542,10 @@ static TranslationEntry translations[] = {
|
||||
{ FALSE, "org.gnome.desktop.privacy", "remember-recent-files", "gtk-recent-files-enabled", G_TYPE_BOOLEAN, { .b = TRUE } },
|
||||
{ FALSE, WM_SETTINGS_SCHEMA, "button-layout", "gtk-decoration-layout", G_TYPE_STRING, { .s = "menu:close" } },
|
||||
{ FALSE, CLASSIC_WM_SETTINGS_SCHEMA, "button-layout", "gtk-decoration-layout", G_TYPE_STRING, { .s = "menu:close" } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "font-antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "font-hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "font-rgba-order", "gtk-xft-rgba", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "antialiasing", "gtk-xft-antialias", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hinting", G_TYPE_NONE, { .i = 0 } },
|
||||
{ FALSE, "org.gnome.settings-daemon.plugins.xsettings", "hinting", "gtk-xft-hintstyle", G_TYPE_NONE, { .i = 0 } },
|
||||
@@ -604,11 +637,14 @@ apply_portal_setting (TranslationEntry *entry,
|
||||
entry->fallback.b = g_variant_get_boolean (value);
|
||||
break;
|
||||
case G_TYPE_NONE:
|
||||
if (strcmp (entry->key, "antialiasing") == 0)
|
||||
if (strcmp (entry->key, "antialiasing") == 0 ||
|
||||
strcmp (entry->key, "font-antialiasing") == 0)
|
||||
entry->fallback.i = get_antialiasing (g_variant_get_string (value, NULL));
|
||||
else if (strcmp (entry->key, "hinting") == 0)
|
||||
else if (strcmp (entry->key, "hinting") == 0 ||
|
||||
strcmp (entry->key, "font-hinting") == 0)
|
||||
entry->fallback.i = get_hinting (g_variant_get_string (value, NULL));
|
||||
else if (strcmp (entry->key, "rgba-order") == 0)
|
||||
else if (strcmp (entry->key, "rgba-order") == 0 ||
|
||||
strcmp (entry->key, "font-rgba-order") == 0)
|
||||
entry->fallback.i = get_order (g_variant_get_string (value, NULL));
|
||||
else if (strcmp (entry->key, "text-scaling-factor") == 0)
|
||||
entry->fallback.i = (int) (g_variant_get_double (value) * 65536.0);
|
||||
@@ -725,6 +761,7 @@ init_settings (GdkScreen *screen)
|
||||
char *a = g_variant_print (v, FALSE);
|
||||
g_debug ("Using portal setting for %s %s: %s\n", schema, key, a);
|
||||
g_free (a);
|
||||
entry->valid = TRUE;
|
||||
apply_portal_setting (entry, v, screen);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -104,7 +104,7 @@ struct _GdkWaylandSelection
|
||||
GArray *source_targets;
|
||||
GdkAtom requested_target;
|
||||
|
||||
struct gtk_primary_selection_source *primary_source;
|
||||
gpointer primary_source;
|
||||
GdkWindow *primary_owner;
|
||||
|
||||
struct wl_data_source *clipboard_source;
|
||||
@@ -434,6 +434,18 @@ gdk_wayland_selection_new (void)
|
||||
return selection;
|
||||
}
|
||||
|
||||
static void
|
||||
primary_selection_source_destroy (gpointer primary_source)
|
||||
{
|
||||
GdkDisplay *display = gdk_display_get_default ();
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
|
||||
if (display_wayland->zwp_primary_selection_manager_v1)
|
||||
zwp_primary_selection_source_v1_destroy (primary_source);
|
||||
else if (display_wayland->gtk_primary_selection_manager)
|
||||
gtk_primary_selection_source_destroy (primary_source);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_wayland_selection_free (GdkWaylandSelection *selection)
|
||||
{
|
||||
@@ -448,7 +460,7 @@ gdk_wayland_selection_free (GdkWaylandSelection *selection)
|
||||
g_ptr_array_unref (selection->stored_selections);
|
||||
|
||||
if (selection->primary_source)
|
||||
gtk_primary_selection_source_destroy (selection->primary_source);
|
||||
primary_selection_source_destroy (selection->primary_source);
|
||||
if (selection->clipboard_source)
|
||||
wl_data_source_destroy (selection->clipboard_source);
|
||||
if (selection->dnd_source)
|
||||
@@ -546,27 +558,47 @@ static const struct wl_data_offer_listener data_offer_listener = {
|
||||
};
|
||||
|
||||
static void
|
||||
primary_offer_offer (void *data,
|
||||
struct gtk_primary_selection_offer *gtk_offer,
|
||||
const char *type)
|
||||
primary_offer_offer (void *data,
|
||||
gpointer offer,
|
||||
const char *type)
|
||||
{
|
||||
GdkWaylandSelection *selection = data;
|
||||
DataOfferData *info;
|
||||
GdkAtom atom = gdk_atom_intern (type, FALSE);
|
||||
|
||||
info = g_hash_table_lookup (selection->offers, gtk_offer);
|
||||
info = g_hash_table_lookup (selection->offers, offer);
|
||||
|
||||
if (!info || g_list_find (info->targets, atom))
|
||||
return;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("primary offer offer, offer %p, type = %s", gtk_offer, type));
|
||||
g_message ("primary offer offer, offer %p, type = %s", offer, type));
|
||||
|
||||
info->targets = g_list_prepend (info->targets, atom);
|
||||
}
|
||||
|
||||
static const struct gtk_primary_selection_offer_listener primary_offer_listener = {
|
||||
primary_offer_offer,
|
||||
static void
|
||||
gtk_primary_offer_offer (void *data,
|
||||
struct gtk_primary_selection_offer *offer,
|
||||
const char *type)
|
||||
{
|
||||
primary_offer_offer (data, (gpointer) offer, type);
|
||||
}
|
||||
|
||||
static void
|
||||
zwp_primary_offer_v1_offer (void *data,
|
||||
struct zwp_primary_selection_offer_v1 *offer,
|
||||
const char *type)
|
||||
{
|
||||
primary_offer_offer (data, (gpointer) offer, type);
|
||||
}
|
||||
|
||||
static const struct gtk_primary_selection_offer_listener gtk_primary_offer_listener = {
|
||||
gtk_primary_offer_offer,
|
||||
};
|
||||
|
||||
static const struct zwp_primary_selection_offer_v1_listener zwp_primary_offer_listener_v1 = {
|
||||
zwp_primary_offer_v1_offer,
|
||||
};
|
||||
|
||||
SelectionData *
|
||||
@@ -604,9 +636,10 @@ gdk_wayland_selection_ensure_offer (GdkDisplay *display,
|
||||
}
|
||||
|
||||
void
|
||||
gdk_wayland_selection_ensure_primary_offer (GdkDisplay *display,
|
||||
struct gtk_primary_selection_offer *gtk_offer)
|
||||
gdk_wayland_selection_ensure_primary_offer (GdkDisplay *display,
|
||||
gpointer gtk_offer)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
GdkWaylandSelection *selection = gdk_wayland_display_get_selection (display);
|
||||
DataOfferData *info;
|
||||
|
||||
@@ -614,12 +647,24 @@ gdk_wayland_selection_ensure_primary_offer (GdkDisplay *
|
||||
|
||||
if (!info)
|
||||
{
|
||||
info = data_offer_data_new (gtk_offer,
|
||||
(GDestroyNotify) gtk_primary_selection_offer_destroy);
|
||||
g_hash_table_insert (selection->offers, gtk_offer, info);
|
||||
gtk_primary_selection_offer_add_listener (gtk_offer,
|
||||
&primary_offer_listener,
|
||||
selection);
|
||||
if (display_wayland->zwp_primary_selection_manager_v1)
|
||||
{
|
||||
info = data_offer_data_new (gtk_offer,
|
||||
(GDestroyNotify) zwp_primary_selection_offer_v1_destroy);
|
||||
g_hash_table_insert (selection->offers, gtk_offer, info);
|
||||
zwp_primary_selection_offer_v1_add_listener (gtk_offer,
|
||||
&zwp_primary_offer_listener_v1,
|
||||
selection);
|
||||
}
|
||||
else if (display_wayland->gtk_primary_selection_manager)
|
||||
{
|
||||
info = data_offer_data_new (gtk_offer,
|
||||
(GDestroyNotify) gtk_primary_selection_offer_destroy);
|
||||
g_hash_table_insert (selection->offers, gtk_offer, info);
|
||||
gtk_primary_selection_offer_add_listener (gtk_offer,
|
||||
>k_primary_offer_listener,
|
||||
selection);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1138,10 +1183,10 @@ static const struct wl_data_source_listener data_source_listener = {
|
||||
};
|
||||
|
||||
static void
|
||||
primary_source_send (void *data,
|
||||
struct gtk_primary_selection_source *source,
|
||||
const char *mime_type,
|
||||
int32_t fd)
|
||||
primary_source_send (void *data,
|
||||
gpointer source,
|
||||
const char *mime_type,
|
||||
int32_t fd)
|
||||
{
|
||||
GdkWaylandSelection *wayland_selection = data;
|
||||
|
||||
@@ -1163,8 +1208,26 @@ primary_source_send (void *data,
|
||||
}
|
||||
|
||||
static void
|
||||
primary_source_cancelled (void *data,
|
||||
struct gtk_primary_selection_source *source)
|
||||
gtk_primary_source_send (void *data,
|
||||
struct gtk_primary_selection_source *source,
|
||||
const char *mime_type,
|
||||
int32_t fd)
|
||||
{
|
||||
primary_source_send (data, (gpointer) source, mime_type, fd);
|
||||
}
|
||||
|
||||
static void
|
||||
zwp_primary_source_v1_send (void *data,
|
||||
struct zwp_primary_selection_source_v1 *source,
|
||||
const char *mime_type,
|
||||
int32_t fd)
|
||||
{
|
||||
primary_source_send (data, (gpointer) source, mime_type, fd);
|
||||
}
|
||||
|
||||
static void
|
||||
primary_source_cancelled (void *data,
|
||||
gpointer source)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkAtom atom;
|
||||
@@ -1180,9 +1243,28 @@ primary_source_cancelled (void *data,
|
||||
gdk_wayland_selection_unset_data_source (display, atom);
|
||||
}
|
||||
|
||||
static const struct gtk_primary_selection_source_listener primary_source_listener = {
|
||||
primary_source_send,
|
||||
primary_source_cancelled,
|
||||
static void
|
||||
gtk_primary_source_cancelled (void *data,
|
||||
struct gtk_primary_selection_source *source)
|
||||
{
|
||||
primary_source_cancelled (data, source);
|
||||
}
|
||||
|
||||
static void
|
||||
zwp_primary_source_v1_cancelled (void *data,
|
||||
struct zwp_primary_selection_source_v1 *source)
|
||||
{
|
||||
primary_source_cancelled (data, source);
|
||||
}
|
||||
|
||||
static const struct gtk_primary_selection_source_listener gtk_primary_source_listener = {
|
||||
gtk_primary_source_send,
|
||||
gtk_primary_source_cancelled,
|
||||
};
|
||||
|
||||
static const struct zwp_primary_selection_source_v1_listener zwp_primary_source_v1_listener = {
|
||||
zwp_primary_source_v1_send,
|
||||
zwp_primary_source_v1_cancelled,
|
||||
};
|
||||
|
||||
struct wl_data_source *
|
||||
@@ -1204,11 +1286,11 @@ gdk_wayland_selection_get_data_source (GdkWindow *owner,
|
||||
{
|
||||
if (wayland_selection->primary_source &&
|
||||
(!owner || owner == wayland_selection->primary_owner))
|
||||
return (gpointer) wayland_selection->primary_source;
|
||||
return wayland_selection->primary_source;
|
||||
|
||||
if (wayland_selection->primary_source)
|
||||
{
|
||||
gtk_primary_selection_source_destroy (wayland_selection->primary_source);
|
||||
primary_selection_source_destroy (wayland_selection->primary_source);
|
||||
wayland_selection->primary_source = NULL;
|
||||
}
|
||||
}
|
||||
@@ -1234,11 +1316,18 @@ gdk_wayland_selection_get_data_source (GdkWindow *owner,
|
||||
|
||||
if (selection == atoms[ATOM_PRIMARY])
|
||||
{
|
||||
if (display_wayland->primary_selection_manager)
|
||||
if (display_wayland->zwp_primary_selection_manager_v1)
|
||||
{
|
||||
source = gtk_primary_selection_device_manager_create_source (display_wayland->primary_selection_manager);
|
||||
source = zwp_primary_selection_device_manager_v1_create_source (display_wayland->zwp_primary_selection_manager_v1);
|
||||
zwp_primary_selection_source_v1_add_listener (source,
|
||||
&zwp_primary_source_v1_listener,
|
||||
wayland_selection);
|
||||
}
|
||||
else if (display_wayland->gtk_primary_selection_manager)
|
||||
{
|
||||
source = gtk_primary_selection_device_manager_create_source (display_wayland->gtk_primary_selection_manager);
|
||||
gtk_primary_selection_source_add_listener (source,
|
||||
&primary_source_listener,
|
||||
>k_primary_source_listener,
|
||||
wayland_selection);
|
||||
}
|
||||
}
|
||||
@@ -1278,7 +1367,7 @@ gdk_wayland_selection_unset_data_source (GdkDisplay *display,
|
||||
{
|
||||
if (wayland_selection->primary_source)
|
||||
{
|
||||
gtk_primary_selection_source_destroy (wayland_selection->primary_source);
|
||||
primary_selection_source_destroy (wayland_selection->primary_source);
|
||||
wayland_selection->primary_source = NULL;
|
||||
}
|
||||
}
|
||||
@@ -1449,6 +1538,7 @@ _gdk_wayland_display_convert_selection (GdkDisplay *display,
|
||||
GdkAtom target,
|
||||
guint32 time)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
|
||||
const SelectionData *selection_data;
|
||||
SelectionBuffer *buffer_data;
|
||||
@@ -1514,9 +1604,16 @@ _gdk_wayland_display_convert_selection (GdkDisplay *display,
|
||||
g_unix_open_pipe (pipe_fd, FD_CLOEXEC, NULL);
|
||||
|
||||
if (selection == atoms[ATOM_PRIMARY])
|
||||
gtk_primary_selection_offer_receive (offer, mimetype, pipe_fd[1]);
|
||||
{
|
||||
if (display_wayland->zwp_primary_selection_manager_v1)
|
||||
zwp_primary_selection_offer_v1_receive (offer, mimetype, pipe_fd[1]);
|
||||
else if (display_wayland->gtk_primary_selection_manager)
|
||||
gtk_primary_selection_offer_receive (offer, mimetype, pipe_fd[1]);
|
||||
}
|
||||
else
|
||||
wl_data_offer_receive (offer, mimetype, pipe_fd[1]);
|
||||
{
|
||||
wl_data_offer_receive (offer, mimetype, pipe_fd[1]);
|
||||
}
|
||||
|
||||
stream = g_unix_input_stream_new (pipe_fd[0], TRUE);
|
||||
close (pipe_fd[1]);
|
||||
|
||||
@@ -77,12 +77,24 @@ GDK_AVAILABLE_IN_3_22
|
||||
gboolean gdk_wayland_window_set_transient_for_exported (GdkWindow *window,
|
||||
char *parent_handle_str);
|
||||
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
void gdk_wayland_window_set_application_id (GdkWindow *window,
|
||||
const char *application_id);
|
||||
|
||||
GDK_AVAILABLE_IN_3_22
|
||||
void gdk_wayland_window_announce_csd (GdkWindow *window);
|
||||
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
void gdk_wayland_window_announce_ssd (GdkWindow *window);
|
||||
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
void gdk_wayland_window_add_frame_callback_surface (GdkWindow *window,
|
||||
struct wl_surface *surface);
|
||||
|
||||
GDK_AVAILABLE_IN_3_24
|
||||
void gdk_wayland_window_remove_frame_callback_surface (GdkWindow *window,
|
||||
struct wl_surface *surface);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_WAYLAND_WINDOW_H__ */
|
||||
|
||||
@@ -202,6 +202,7 @@ struct _GdkWindowImplWayland
|
||||
|
||||
int saved_width;
|
||||
int saved_height;
|
||||
gboolean saved_size_changed;
|
||||
|
||||
int unconfigured_width;
|
||||
int unconfigured_height;
|
||||
@@ -235,6 +236,9 @@ struct _GdkWindowImplWayland
|
||||
|
||||
struct zxdg_imported_v1 *imported_transient_for;
|
||||
GHashTable *shortcuts_inhibitors;
|
||||
|
||||
struct wl_callback *surface_callback;
|
||||
GHashTable *frame_callback_surfaces;
|
||||
};
|
||||
|
||||
struct _GdkWindowImplWaylandClass
|
||||
@@ -273,6 +277,7 @@ static void gdk_wayland_window_unexport (GdkWindow *window);
|
||||
static void gdk_wayland_window_announce_decoration_mode (GdkWindow *window);
|
||||
|
||||
static gboolean should_map_as_subsurface (GdkWindow *window);
|
||||
static gboolean should_map_as_popup (GdkWindow *window);
|
||||
|
||||
GType _gdk_window_impl_wayland_get_type (void);
|
||||
|
||||
@@ -312,6 +317,42 @@ drop_cairo_surfaces (GdkWindow *window)
|
||||
impl->committed_cairo_surface = NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
calculate_width_without_margin (GdkWindow *window,
|
||||
int width)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
return width - (impl->margin_left + impl->margin_right);
|
||||
}
|
||||
|
||||
static int
|
||||
calculate_height_without_margin (GdkWindow *window,
|
||||
int height)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
return height - (impl->margin_top + impl->margin_bottom);
|
||||
}
|
||||
|
||||
static int
|
||||
calculate_width_with_margin (GdkWindow *window,
|
||||
int width)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
return width + impl->margin_left + impl->margin_right;
|
||||
}
|
||||
|
||||
static int
|
||||
calculate_height_with_margin (GdkWindow *window,
|
||||
int height)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
return height + impl->margin_top + impl->margin_bottom;
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_wayland_window_save_size (GdkWindow *window)
|
||||
{
|
||||
@@ -322,8 +363,8 @@ _gdk_wayland_window_save_size (GdkWindow *window)
|
||||
GDK_WINDOW_STATE_TILED))
|
||||
return;
|
||||
|
||||
impl->saved_width = window->width - impl->margin_left - impl->margin_right;
|
||||
impl->saved_height = window->height - impl->margin_top - impl->margin_bottom;
|
||||
impl->saved_width = calculate_width_without_margin (window, window->width);
|
||||
impl->saved_height = calculate_height_without_margin (window, window->height);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -534,9 +575,25 @@ frame_callback (void *data,
|
||||
GdkFrameClock *clock = gdk_window_get_frame_clock (window);
|
||||
GdkFrameTimings *timings;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("frame %p", window));
|
||||
if (callback == impl->surface_callback)
|
||||
{
|
||||
impl->surface_callback = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
GHashTableIter iter;
|
||||
gpointer surface_callback;
|
||||
|
||||
g_hash_table_iter_init (&iter, impl->frame_callback_surfaces);
|
||||
while (g_hash_table_iter_next (&iter, NULL, &surface_callback))
|
||||
{
|
||||
if (callback == surface_callback)
|
||||
{
|
||||
g_hash_table_iter_replace (&iter, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
wl_callback_destroy (callback);
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
@@ -545,6 +602,9 @@ frame_callback (void *data,
|
||||
if (!impl->awaiting_frame)
|
||||
return;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("frame %p", window));
|
||||
|
||||
impl->awaiting_frame = FALSE;
|
||||
_gdk_frame_clock_thaw (clock);
|
||||
|
||||
@@ -622,6 +682,8 @@ on_frame_clock_after_paint (GdkFrameClock *clock,
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
struct wl_callback *callback;
|
||||
GHashTableIter iter;
|
||||
gpointer surface, surface_callback;
|
||||
|
||||
if (!impl->pending_commit)
|
||||
return;
|
||||
@@ -629,8 +691,6 @@ on_frame_clock_after_paint (GdkFrameClock *clock,
|
||||
if (window->update_freeze_count > 0)
|
||||
return;
|
||||
|
||||
callback = wl_surface_frame (impl->display_server.wl_surface);
|
||||
wl_callback_add_listener (callback, &frame_listener, window);
|
||||
_gdk_frame_clock_freeze (clock);
|
||||
|
||||
/* Before we commit a new buffer, make sure we've backfilled
|
||||
@@ -639,6 +699,24 @@ on_frame_clock_after_paint (GdkFrameClock *clock,
|
||||
if (impl->pending_buffer_attached)
|
||||
read_back_cairo_surface (window);
|
||||
|
||||
if (impl->surface_callback == NULL)
|
||||
{
|
||||
callback = wl_surface_frame (impl->display_server.wl_surface);
|
||||
wl_callback_add_listener (callback, &frame_listener, window);
|
||||
impl->surface_callback = callback;
|
||||
}
|
||||
|
||||
g_hash_table_iter_init (&iter, impl->frame_callback_surfaces);
|
||||
while (g_hash_table_iter_next (&iter, &surface, &surface_callback))
|
||||
{
|
||||
if (surface_callback)
|
||||
continue;
|
||||
|
||||
callback = wl_surface_frame (surface);
|
||||
wl_callback_add_listener (callback, &frame_listener, window);
|
||||
g_hash_table_iter_replace (&iter, callback);
|
||||
}
|
||||
|
||||
/* From this commit forward, we can't write to the buffer,
|
||||
* it's "live". In the future, if we need to stage more changes
|
||||
* we have to allocate a new staging buffer and draw to it instead.
|
||||
@@ -713,9 +791,13 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
|
||||
|
||||
impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WAYLAND, NULL);
|
||||
window->impl = GDK_WINDOW_IMPL (impl);
|
||||
impl->unconfigured_width = window->width;
|
||||
impl->unconfigured_height = window->height;
|
||||
impl->wrapper = GDK_WINDOW (window);
|
||||
impl->shortcuts_inhibitors = g_hash_table_new (NULL, NULL);
|
||||
impl->using_csd = TRUE;
|
||||
impl->surface_callback = NULL;
|
||||
impl->frame_callback_surfaces = g_hash_table_new (NULL, NULL);
|
||||
|
||||
if (window->width > 65535)
|
||||
{
|
||||
@@ -1027,6 +1109,7 @@ gdk_window_impl_wayland_finalize (GObject *object)
|
||||
g_clear_pointer (&impl->staged_updates_region, cairo_region_destroy);
|
||||
|
||||
g_clear_pointer (&impl->shortcuts_inhibitors, g_hash_table_unref);
|
||||
g_clear_pointer (&impl->frame_callback_surfaces, g_hash_table_unref);
|
||||
|
||||
G_OBJECT_CLASS (_gdk_window_impl_wayland_parent_class)->finalize (object);
|
||||
}
|
||||
@@ -1040,6 +1123,9 @@ gdk_wayland_window_configure (GdkWindow *window,
|
||||
GdkDisplay *display;
|
||||
GdkEvent *event;
|
||||
|
||||
g_return_if_fail (width > 0);
|
||||
g_return_if_fail (height > 0);
|
||||
|
||||
event = gdk_event_new (GDK_CONFIGURE);
|
||||
event->configure.window = g_object_ref (window);
|
||||
event->configure.send_event = FALSE;
|
||||
@@ -1081,18 +1167,27 @@ is_realized_popup (GdkWindow *window)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
needs_initial_configure (GdkWindow *window)
|
||||
should_inhibit_resize (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
if (impl->display_server.wl_subsurface)
|
||||
return FALSE;
|
||||
else if (is_realized_toplevel (window))
|
||||
return TRUE;
|
||||
else if (impl->use_custom_surface)
|
||||
return FALSE;
|
||||
else if (impl->hint == GDK_WINDOW_TYPE_HINT_DND)
|
||||
return FALSE;
|
||||
else if (is_realized_popup (window))
|
||||
return TRUE;
|
||||
else
|
||||
return !should_map_as_subsurface (window);
|
||||
return FALSE;
|
||||
else if (should_map_as_popup (window))
|
||||
return FALSE;
|
||||
else if (should_map_as_subsurface (window))
|
||||
return FALSE;
|
||||
|
||||
/* This should now either be, or eventually be, a toplevel window,
|
||||
* and we should wait for the initial configure to really configure it.
|
||||
*/
|
||||
return !impl->initial_configure_received;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1105,19 +1200,17 @@ gdk_wayland_window_maybe_configure (GdkWindow *window,
|
||||
gboolean is_xdg_popup;
|
||||
gboolean is_visible;
|
||||
|
||||
impl->unconfigured_width = calculate_width_without_margin (window, width);
|
||||
impl->unconfigured_height = calculate_height_without_margin (window, height);
|
||||
|
||||
if (should_inhibit_resize (window))
|
||||
return;
|
||||
|
||||
if (window->width == width &&
|
||||
window->height == height &&
|
||||
impl->scale == scale)
|
||||
return;
|
||||
|
||||
if (needs_initial_configure (window) &&
|
||||
!impl->initial_configure_received)
|
||||
{
|
||||
impl->unconfigured_width = width;
|
||||
impl->unconfigured_height = height;
|
||||
return;
|
||||
}
|
||||
|
||||
/* For xdg_popup using an xdg_positioner, there is a race condition if
|
||||
* the application tries to change the size after it's mapped, but before
|
||||
* the initial configure is received, so hide and show the surface again
|
||||
@@ -1282,8 +1375,8 @@ gdk_wayland_window_get_window_geometry (GdkWindow *window,
|
||||
*geometry = (GdkRectangle) {
|
||||
.x = impl->margin_left,
|
||||
.y = impl->margin_top,
|
||||
.width = window->width - (impl->margin_left + impl->margin_right),
|
||||
.height = window->height - (impl->margin_top + impl->margin_bottom)
|
||||
.width = calculate_width_without_margin (window, window->width),
|
||||
.height = calculate_height_without_margin (window, window->height)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1299,6 +1392,9 @@ gdk_wayland_window_sync_margin (GdkWindow *window)
|
||||
return;
|
||||
|
||||
gdk_wayland_window_get_window_geometry (window, &geometry);
|
||||
|
||||
g_return_if_fail (geometry.width > 0 && geometry.height > 0);
|
||||
|
||||
gdk_window_set_geometry_hints (window,
|
||||
&impl->geometry_hints,
|
||||
impl->geometry_mask);
|
||||
@@ -1588,11 +1684,16 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
|
||||
* When transitioning from maximize or fullscreen state, this means
|
||||
* the client should configure its size back to what it was before
|
||||
* being maximize or fullscreen.
|
||||
* Additionally, if we receive a manual resize request, we must prefer this
|
||||
* new size instead of the compositor's size hints.
|
||||
* In such a scenario, and without letting the compositor know about the new
|
||||
* size, the client has to manage all dimensions and ignore any server hints.
|
||||
*/
|
||||
if (saved_size && !fixed_size)
|
||||
if (!fixed_size && (saved_size || impl->saved_size_changed))
|
||||
{
|
||||
width = impl->saved_width;
|
||||
height = impl->saved_height;
|
||||
impl->saved_size_changed = FALSE;
|
||||
}
|
||||
|
||||
if (width > 0 && height > 0)
|
||||
@@ -1609,8 +1710,8 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
|
||||
/* Do not reapply contrains if we are restoring original size */
|
||||
gdk_window_constrain_size (&impl->geometry_hints,
|
||||
geometry_mask,
|
||||
width + impl->margin_left + impl->margin_right,
|
||||
height + impl->margin_top + impl->margin_bottom,
|
||||
calculate_width_with_margin (window, width),
|
||||
calculate_height_with_margin (window, height),
|
||||
&width,
|
||||
&height);
|
||||
|
||||
@@ -1620,8 +1721,8 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
|
||||
|
||||
if (saved_size)
|
||||
{
|
||||
configure_width = width + impl->margin_left + impl->margin_right;
|
||||
configure_height = height + impl->margin_top + impl->margin_bottom;
|
||||
configure_width = calculate_width_with_margin (window, width);
|
||||
configure_height = calculate_height_with_margin (window, height);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1635,9 +1736,16 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
|
||||
}
|
||||
else
|
||||
{
|
||||
int unconfigured_width;
|
||||
int unconfigured_height;
|
||||
|
||||
unconfigured_width =
|
||||
calculate_width_with_margin (window, impl->unconfigured_width);
|
||||
unconfigured_height =
|
||||
calculate_height_with_margin (window, impl->unconfigured_height);
|
||||
gdk_wayland_window_configure (window,
|
||||
impl->unconfigured_width,
|
||||
impl->unconfigured_height,
|
||||
unconfigured_width,
|
||||
unconfigured_height,
|
||||
impl->scale);
|
||||
}
|
||||
|
||||
@@ -1877,6 +1985,36 @@ create_zxdg_toplevel_v6_resources (GdkWindow *window)
|
||||
window);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_wayland_window_set_application_id (GdkWindow *window, const char* application_id)
|
||||
{
|
||||
GdkWindowImplWayland *impl;
|
||||
GdkWaylandDisplay *display_wayland;
|
||||
|
||||
g_return_if_fail (application_id != NULL);
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
if (!is_realized_toplevel (window))
|
||||
return;
|
||||
|
||||
display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
switch (display_wayland->shell_variant)
|
||||
{
|
||||
case GDK_WAYLAND_SHELL_VARIANT_XDG_SHELL:
|
||||
xdg_toplevel_set_app_id (impl->display_server.xdg_toplevel,
|
||||
application_id);
|
||||
break;
|
||||
case GDK_WAYLAND_SHELL_VARIANT_ZXDG_SHELL_V6:
|
||||
zxdg_toplevel_v6_set_app_id (impl->display_server.zxdg_toplevel_v6,
|
||||
application_id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_window_create_xdg_toplevel (GdkWindow *window)
|
||||
{
|
||||
@@ -1932,17 +2070,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
if (app_id == NULL)
|
||||
app_id = gdk_get_program_class ();
|
||||
|
||||
switch (display_wayland->shell_variant)
|
||||
{
|
||||
case GDK_WAYLAND_SHELL_VARIANT_XDG_SHELL:
|
||||
xdg_toplevel_set_app_id (impl->display_server.xdg_toplevel,
|
||||
app_id);
|
||||
break;
|
||||
case GDK_WAYLAND_SHELL_VARIANT_ZXDG_SHELL_V6:
|
||||
zxdg_toplevel_v6_set_app_id (impl->display_server.zxdg_toplevel_v6,
|
||||
app_id);
|
||||
break;
|
||||
}
|
||||
gdk_wayland_window_set_application_id (window, app_id);
|
||||
|
||||
maybe_set_gtk_surface_dbus_properties (window);
|
||||
maybe_set_gtk_surface_modal (window);
|
||||
@@ -2479,12 +2607,17 @@ calculate_moved_to_rect_result (GdkWindow *window,
|
||||
gboolean *flipped_x,
|
||||
gboolean *flipped_y)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
GdkWindowImplWayland *impl;
|
||||
GdkWindow *parent;
|
||||
gint window_x, window_y;
|
||||
gint window_width, window_height;
|
||||
GdkRectangle best_rect;
|
||||
|
||||
g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window));
|
||||
g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (window->impl));
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
parent = translate_from_real_parent_window_geometry (window, &x, &y);
|
||||
*final_rect = (GdkRectangle) {
|
||||
.x = x,
|
||||
@@ -2899,10 +3032,6 @@ should_map_as_popup (GdkWindow *window)
|
||||
if (impl->grab_input_seat)
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
g_message ("Window %p is a temporary window without parent, "
|
||||
"application will not be able to position it on screen.",
|
||||
window);
|
||||
}
|
||||
|
||||
/* Yet we need to keep the window type hint tests for compatibility */
|
||||
@@ -2987,6 +3116,16 @@ gdk_wayland_window_map (GdkWindow *window)
|
||||
if (impl->mapped || impl->use_custom_surface)
|
||||
return;
|
||||
|
||||
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP)
|
||||
{
|
||||
if (!impl->transient_for)
|
||||
{
|
||||
g_message ("Window %p is a temporary window without parent, "
|
||||
"application will not be able to position it on screen.",
|
||||
window);
|
||||
}
|
||||
}
|
||||
|
||||
if (should_map_as_subsurface (window))
|
||||
{
|
||||
if (impl->transient_for)
|
||||
@@ -3239,7 +3378,11 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
|
||||
|
||||
if (impl->display_server.gtk_surface)
|
||||
{
|
||||
gtk_surface1_destroy (impl->display_server.gtk_surface);
|
||||
if (display_wayland->gtk_shell_version >=
|
||||
GTK_SURFACE1_RELEASE_SINCE_VERSION)
|
||||
gtk_surface1_release (impl->display_server.gtk_surface);
|
||||
else
|
||||
gtk_surface1_destroy (impl->display_server.gtk_surface);
|
||||
impl->display_server.gtk_surface = NULL;
|
||||
impl->application.was_set = FALSE;
|
||||
}
|
||||
@@ -3252,6 +3395,7 @@ gdk_wayland_window_hide_surface (GdkWindow *window)
|
||||
|
||||
wl_surface_destroy (impl->display_server.wl_surface);
|
||||
impl->display_server.wl_surface = NULL;
|
||||
impl->surface_callback = NULL;
|
||||
|
||||
g_slist_free (impl->display_server.outputs);
|
||||
impl->display_server.outputs = NULL;
|
||||
@@ -3391,6 +3535,7 @@ gdk_window_wayland_move_resize (GdkWindow *window,
|
||||
{
|
||||
impl->saved_width = width;
|
||||
impl->saved_height = height;
|
||||
impl->saved_size_changed = (width > 0 && height > 0);
|
||||
}
|
||||
|
||||
/* If this function is called with width and height = -1 then that means
|
||||
@@ -3401,7 +3546,19 @@ gdk_window_wayland_move_resize (GdkWindow *window,
|
||||
if (!should_use_fixed_size (window->state) ||
|
||||
(width == impl->fixed_size_width &&
|
||||
height == impl->fixed_size_height))
|
||||
gdk_wayland_window_maybe_configure (window, width, height, impl->scale);
|
||||
{
|
||||
gdk_wayland_window_maybe_configure (window,
|
||||
width,
|
||||
height,
|
||||
impl->scale);
|
||||
}
|
||||
else if (!should_inhibit_resize (window))
|
||||
{
|
||||
gdk_wayland_window_configure (window,
|
||||
window->width,
|
||||
window->height,
|
||||
impl->scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3841,14 +3998,18 @@ gdk_wayland_window_set_geometry_hints (GdkWindow *window,
|
||||
|
||||
if (geom_mask & GDK_HINT_MIN_SIZE)
|
||||
{
|
||||
min_width = MAX (0, geometry->min_width - (impl->margin_left + impl->margin_right));
|
||||
min_height = MAX (0, geometry->min_height - (impl->margin_top + impl->margin_bottom));
|
||||
min_width =
|
||||
MAX (0, calculate_width_without_margin (window, geometry->min_width));
|
||||
min_height =
|
||||
MAX (0, calculate_height_without_margin (window, geometry->min_height));
|
||||
}
|
||||
|
||||
if (geom_mask & GDK_HINT_MAX_SIZE)
|
||||
{
|
||||
max_width = MAX (0, geometry->max_width - (impl->margin_left + impl->margin_right));
|
||||
max_height = MAX (0, geometry->max_height - (impl->margin_top + impl->margin_bottom));
|
||||
max_width =
|
||||
MAX (0, calculate_width_without_margin (window, geometry->max_width));
|
||||
max_height =
|
||||
MAX (0, calculate_height_without_margin (window, geometry->max_height));
|
||||
}
|
||||
|
||||
switch (display_wayland->shell_variant)
|
||||
@@ -4527,10 +4688,10 @@ gdk_wayland_window_set_shadow_width (GdkWindow *window,
|
||||
return;
|
||||
|
||||
/* Reconfigure window to keep the same window geometry */
|
||||
new_width = window->width -
|
||||
(impl->margin_left + impl->margin_right) + (left + right);
|
||||
new_height = window->height -
|
||||
(impl->margin_top + impl->margin_bottom) + (top + bottom);
|
||||
new_width = (calculate_width_without_margin (window, window->width) +
|
||||
(left + right));
|
||||
new_height = (calculate_height_without_margin (window, window->height) +
|
||||
(top + bottom));
|
||||
gdk_wayland_window_maybe_configure (window, new_width, new_height, impl->scale);
|
||||
|
||||
impl->margin_left = left;
|
||||
@@ -5262,10 +5423,16 @@ void
|
||||
gdk_wayland_window_restore_shortcuts (GdkWindow *window,
|
||||
GdkSeat *gdk_seat)
|
||||
{
|
||||
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
struct wl_seat *seat = gdk_wayland_seat_get_wl_seat (gdk_seat);
|
||||
GdkWindowImplWayland *impl;
|
||||
struct wl_seat *seat;
|
||||
struct zwp_keyboard_shortcuts_inhibitor_v1 *inhibitor;
|
||||
|
||||
g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window));
|
||||
g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (window->impl));
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
seat = gdk_wayland_seat_get_wl_seat (gdk_seat);
|
||||
|
||||
inhibitor = gdk_wayland_window_get_inhibitor (impl, seat);
|
||||
if (inhibitor == NULL)
|
||||
return; /* Not inhibitted */
|
||||
@@ -5274,3 +5441,71 @@ gdk_wayland_window_restore_shortcuts (GdkWindow *window,
|
||||
g_hash_table_remove (impl->shortcuts_inhibitors, seat);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_wayland_window_add_frame_callback_surface:
|
||||
* @window: the #GdkWindow requesting callbacks
|
||||
* @surface: the wl_surface to add
|
||||
*
|
||||
* Add @surface to a list of surfaces for which frame callback
|
||||
* listeners will get set up, additionally to the one of @window.
|
||||
*
|
||||
* This is useful when clients use subsurfaces independently of GDK.
|
||||
* For example if a client creates a subsurface that covers @window
|
||||
* entirely. If this subsurface is opaque, Wayland compositors may not
|
||||
* emit callbacks for the surface of @window any more.
|
||||
* Adding the covering subsurface via this function ensures the
|
||||
* @window will continue to update.
|
||||
*
|
||||
* A single callback is sufficient to trigger the next update. If more
|
||||
* than one are triggered, the later ones will get ignored.
|
||||
*
|
||||
* Before @surface gets destroyed it must get removed again using
|
||||
* gdk_wayland_window_remove_frame_callback_surface().
|
||||
*
|
||||
* Note that the client is responsible to commit the @surface.
|
||||
* One way to archive this is to always commit after the
|
||||
* #GdkSurface::after-paint signal was triggered.
|
||||
*
|
||||
* Since: 3.24.25
|
||||
*/
|
||||
void
|
||||
gdk_wayland_window_add_frame_callback_surface (GdkWindow *window,
|
||||
struct wl_surface *surface)
|
||||
{
|
||||
GdkWindowImplWayland *impl;
|
||||
|
||||
g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window));
|
||||
g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (window->impl));
|
||||
g_return_if_fail (surface != NULL);
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
g_hash_table_insert (impl->frame_callback_surfaces, surface, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_wayland_window_remove_frame_callback_surface:
|
||||
* @window: the #GdkWindow requesting callbacks
|
||||
* @surface: the surface to remove
|
||||
*
|
||||
* Remove @surface from the list of surfaces again that got added via
|
||||
* gdk_wayland_window_add_frame_callback_surface().
|
||||
*
|
||||
* This function must be called before @surface gets destroyed.
|
||||
*
|
||||
* Since: 3.24.25
|
||||
*/
|
||||
void
|
||||
gdk_wayland_window_remove_frame_callback_surface (GdkWindow *window,
|
||||
struct wl_surface *surface)
|
||||
{
|
||||
GdkWindowImplWayland *impl;
|
||||
|
||||
g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window));
|
||||
g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (window->impl));
|
||||
g_return_if_fail (surface != NULL);
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
g_hash_table_remove (impl->frame_callback_surfaces, surface);
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ proto_sources = [
|
||||
['keyboard-shortcuts-inhibit', 'unstable', 'v1', ],
|
||||
['server-decoration', 'private' ],
|
||||
['xdg-output', 'unstable', 'v1', ],
|
||||
['primary-selection', 'unstable', 'v1', ],
|
||||
]
|
||||
|
||||
gdk_wayland_gen_headers = []
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<protocol name="gtk">
|
||||
|
||||
<interface name="gtk_shell1" version="3">
|
||||
<interface name="gtk_shell1" version="4">
|
||||
<description summary="gtk specific extensions">
|
||||
gtk_shell is a protocol extension providing additional features for
|
||||
clients implementing it.
|
||||
@@ -35,7 +35,7 @@
|
||||
</request>
|
||||
</interface>
|
||||
|
||||
<interface name="gtk_surface1" version="3">
|
||||
<interface name="gtk_surface1" version="4">
|
||||
<request name="set_dbus_properties">
|
||||
<arg name="application_id" type="string" allow-null="true"/>
|
||||
<arg name="app_menu_path" type="string" allow-null="true"/>
|
||||
@@ -82,6 +82,9 @@
|
||||
<request name="request_focus" since="3">
|
||||
<arg name="startup_id" type="string" allow-null="true"/>
|
||||
</request>
|
||||
|
||||
<!-- Version 4 additions -->
|
||||
<request name="release" type="destructor" since="4"/>
|
||||
</interface>
|
||||
|
||||
</protocol>
|
||||
|
||||
@@ -107,10 +107,10 @@ gdk3_win32_HEADERS_INST = $(libgdkwin32include_HEADERS)
|
||||
|
||||
gdk3_win32_HEADERS_EXCLUDES = dummy
|
||||
|
||||
include $(top_srcdir)/build/Makefile.msvcproj
|
||||
include $(top_srcdir)/win32/Makefile.msvcproj
|
||||
|
||||
dist-hook: \
|
||||
$(top_builddir)/build/win32/vs9/gdk3-win32.vcproj \
|
||||
$(top_builddir)/build/win32/vs9/gdk3-win32.headers
|
||||
$(top_builddir)/win32/vs9/gdk3-win32.vcproj \
|
||||
$(top_builddir)/win32/vs9/gdk3-win32.headers
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
||||
@@ -37,6 +37,10 @@
|
||||
|
||||
#include "gdkwin32langnotification.h"
|
||||
|
||||
#ifndef IMAGE_FILE_MACHINE_ARM64
|
||||
# define IMAGE_FILE_MACHINE_ARM64 0xAA64
|
||||
#endif
|
||||
|
||||
static int debug_indent = 0;
|
||||
|
||||
static GdkMonitor *
|
||||
@@ -1034,6 +1038,40 @@ _gdk_win32_enable_hidpi (GdkWin32Display *display)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_win32_check_on_arm64 (GdkWin32Display *display)
|
||||
{
|
||||
static gsize checked = 0;
|
||||
|
||||
if (g_once_init_enter (&checked))
|
||||
{
|
||||
HMODULE kernel32 = LoadLibraryW (L"kernel32.dll");
|
||||
|
||||
if (kernel32 != NULL)
|
||||
{
|
||||
display->cpu_funcs.isWow64Process2 =
|
||||
(funcIsWow64Process2) GetProcAddress (kernel32, "IsWow64Process2");
|
||||
|
||||
if (display->cpu_funcs.isWow64Process2 != NULL)
|
||||
{
|
||||
USHORT proc_cpu = 0;
|
||||
USHORT native_cpu = 0;
|
||||
|
||||
display->cpu_funcs.isWow64Process2 (GetCurrentProcess (),
|
||||
&proc_cpu,
|
||||
&native_cpu);
|
||||
|
||||
if (native_cpu == IMAGE_FILE_MACHINE_ARM64)
|
||||
display->running_on_arm64 = TRUE;
|
||||
}
|
||||
|
||||
FreeLibrary (kernel32);
|
||||
}
|
||||
|
||||
g_once_init_leave (&checked, 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_win32_display_init (GdkWin32Display *display)
|
||||
{
|
||||
@@ -1042,6 +1080,7 @@ gdk_win32_display_init (GdkWin32Display *display)
|
||||
display->monitors = g_ptr_array_new_with_free_func (g_object_unref);
|
||||
|
||||
_gdk_win32_enable_hidpi (display);
|
||||
_gdk_win32_check_on_arm64 (display);
|
||||
|
||||
/* if we have DPI awareness, set up fixed scale if set */
|
||||
if (display->dpi_aware_type != PROCESS_DPI_UNAWARE &&
|
||||
|
||||
@@ -60,6 +60,13 @@ typedef struct _GdkWin32User32DPIFuncs
|
||||
funcIsProcessDPIAware isDpiAwareFunc;
|
||||
} GdkWin32User32DPIFuncs;
|
||||
|
||||
/* Detect running architecture */
|
||||
typedef BOOL (WINAPI *funcIsWow64Process2) (HANDLE, USHORT *, USHORT *);
|
||||
typedef struct _GdkWin32KernelCPUFuncs
|
||||
{
|
||||
funcIsWow64Process2 isWow64Process2;
|
||||
} GdkWin32KernelCPUFuncs;
|
||||
|
||||
struct _GdkWin32Display
|
||||
{
|
||||
GdkDisplay display;
|
||||
@@ -95,6 +102,9 @@ struct _GdkWin32Display
|
||||
guint hasWglARBPixelFormat : 1;
|
||||
guint hasWglARBmultisample : 1;
|
||||
|
||||
/* compensate around Intel OpenGL driver issues on blitting, see issue #3487 */
|
||||
guint needIntelGLWorkaround : 1;
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
guint hasEglKHRCreateContext : 1;
|
||||
guint hasEglSurfacelessContext : 1;
|
||||
@@ -109,6 +119,10 @@ struct _GdkWin32Display
|
||||
|
||||
GdkWin32ShcoreFuncs shcore_funcs;
|
||||
GdkWin32User32DPIFuncs user32_dpi_funcs;
|
||||
|
||||
/* Running CPU items */
|
||||
guint running_on_arm64 : 1;
|
||||
GdkWin32KernelCPUFuncs cpu_funcs;
|
||||
};
|
||||
|
||||
struct _GdkWin32DisplayClass
|
||||
|
||||
@@ -1863,202 +1863,6 @@ generate_button_event (GdkEventType type,
|
||||
_gdk_win32_append_event (event);
|
||||
}
|
||||
|
||||
/*
|
||||
* Used by the stacking functions to see if a window
|
||||
* should be always on top.
|
||||
* Restacking is only done if both windows are either ontop
|
||||
* or not ontop.
|
||||
*/
|
||||
static gboolean
|
||||
should_window_be_always_on_top (GdkWindow *window)
|
||||
{
|
||||
DWORD exstyle;
|
||||
|
||||
if ((GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP) ||
|
||||
(window->state & GDK_WINDOW_STATE_ABOVE))
|
||||
return TRUE;
|
||||
|
||||
exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
|
||||
|
||||
if (exstyle & WS_EX_TOPMOST)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
ensure_stacking_on_unminimize (MSG *msg)
|
||||
{
|
||||
HWND rover;
|
||||
HWND lowest_transient = NULL;
|
||||
GdkWindow *msg_window;
|
||||
gboolean window_ontop = FALSE;
|
||||
|
||||
msg_window = gdk_win32_handle_table_lookup (msg->hwnd);
|
||||
|
||||
if (msg_window)
|
||||
window_ontop = should_window_be_always_on_top (msg_window);
|
||||
|
||||
for (rover = GetNextWindow (msg->hwnd, GW_HWNDNEXT);
|
||||
rover;
|
||||
rover = GetNextWindow (rover, GW_HWNDNEXT))
|
||||
{
|
||||
GdkWindow *rover_gdkw = gdk_win32_handle_table_lookup (rover);
|
||||
GdkWindowImplWin32 *rover_impl;
|
||||
gboolean rover_ontop;
|
||||
|
||||
/* Checking window group not implemented yet */
|
||||
if (rover_gdkw == NULL)
|
||||
continue;
|
||||
|
||||
rover_ontop = should_window_be_always_on_top (rover_gdkw);
|
||||
rover_impl = GDK_WINDOW_IMPL_WIN32 (rover_gdkw->impl);
|
||||
|
||||
if (GDK_WINDOW_IS_MAPPED (rover_gdkw) &&
|
||||
(rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
|
||||
rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
|
||||
rover_impl->transient_owner != NULL) &&
|
||||
((window_ontop && rover_ontop) || (!window_ontop && !rover_ontop)))
|
||||
{
|
||||
lowest_transient = rover;
|
||||
}
|
||||
}
|
||||
|
||||
if (lowest_transient != NULL)
|
||||
{
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print (" restacking %p above %p",
|
||||
msg->hwnd, lowest_transient));
|
||||
SetWindowPos (msg->hwnd, lowest_transient, 0, 0, 0, 0,
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
ensure_stacking_on_window_pos_changing (MSG *msg,
|
||||
GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
WINDOWPOS *windowpos = (WINDOWPOS *) msg->lParam;
|
||||
HWND rover;
|
||||
gboolean restacking;
|
||||
gboolean window_ontop;
|
||||
|
||||
if (GetActiveWindow () != msg->hwnd ||
|
||||
impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
|
||||
impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
|
||||
impl->transient_owner != NULL)
|
||||
return FALSE;
|
||||
|
||||
/* Make sure the window stays behind any transient-type windows
|
||||
* of the same window group.
|
||||
*
|
||||
* If the window is not active and being activated, we let
|
||||
* Windows bring it to the top and rely on the WM_ACTIVATEAPP
|
||||
* handling to bring any utility windows on top of it.
|
||||
*/
|
||||
|
||||
window_ontop = should_window_be_always_on_top (window);
|
||||
|
||||
for (rover = windowpos->hwndInsertAfter, restacking = FALSE;
|
||||
rover;
|
||||
rover = GetNextWindow (rover, GW_HWNDNEXT))
|
||||
{
|
||||
GdkWindow *rover_gdkw = gdk_win32_handle_table_lookup (rover);
|
||||
GdkWindowImplWin32 *rover_impl;
|
||||
gboolean rover_ontop;
|
||||
|
||||
/* Checking window group not implemented yet */
|
||||
|
||||
if (rover_gdkw == NULL)
|
||||
continue;
|
||||
|
||||
rover_ontop = should_window_be_always_on_top (rover_gdkw);
|
||||
rover_impl = GDK_WINDOW_IMPL_WIN32 (rover_gdkw->impl);
|
||||
|
||||
if (GDK_WINDOW_IS_MAPPED (rover_gdkw) &&
|
||||
(rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
|
||||
rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
|
||||
rover_impl->transient_owner != NULL) &&
|
||||
((window_ontop && rover_ontop) || (!window_ontop && !rover_ontop)))
|
||||
{
|
||||
restacking = TRUE;
|
||||
windowpos->hwndInsertAfter = rover;
|
||||
}
|
||||
}
|
||||
|
||||
if (restacking)
|
||||
{
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print (" letting Windows restack %p above %p",
|
||||
msg->hwnd, windowpos->hwndInsertAfter));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
ensure_stacking_on_activate_app (MSG *msg,
|
||||
GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
HWND rover;
|
||||
gboolean window_ontop;
|
||||
|
||||
if (impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
|
||||
impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
|
||||
impl->transient_owner != NULL)
|
||||
{
|
||||
SetWindowPos (msg->hwnd, HWND_TOP, 0, 0, 0, 0,
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsWindowVisible (msg->hwnd) ||
|
||||
msg->hwnd != GetActiveWindow ())
|
||||
return;
|
||||
|
||||
|
||||
/* This window is not a transient-type window and it is the
|
||||
* activated window. Make sure this window is as visible as
|
||||
* possible, just below the lowest transient-type window of this
|
||||
* app.
|
||||
*/
|
||||
|
||||
window_ontop = should_window_be_always_on_top (window);
|
||||
|
||||
for (rover = GetNextWindow (msg->hwnd, GW_HWNDPREV);
|
||||
rover;
|
||||
rover = GetNextWindow (rover, GW_HWNDPREV))
|
||||
{
|
||||
GdkWindow *rover_gdkw = gdk_win32_handle_table_lookup (rover);
|
||||
GdkWindowImplWin32 *rover_impl;
|
||||
gboolean rover_ontop;
|
||||
|
||||
/* Checking window group not implemented yet */
|
||||
if (rover_gdkw == NULL)
|
||||
continue;
|
||||
|
||||
rover_ontop = should_window_be_always_on_top (rover_gdkw);
|
||||
rover_impl = GDK_WINDOW_IMPL_WIN32 (rover_gdkw->impl);
|
||||
|
||||
if (GDK_WINDOW_IS_MAPPED (rover_gdkw) &&
|
||||
(rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
|
||||
rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
|
||||
rover_impl->transient_owner != NULL) &&
|
||||
((window_ontop && rover_ontop) || (!window_ontop && !rover_ontop)))
|
||||
{
|
||||
GDK_NOTE (EVENTS,
|
||||
g_print (" restacking %p above %p",
|
||||
msg->hwnd, rover));
|
||||
SetWindowPos (msg->hwnd, rover, 0, 0, 0, 0,
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
handle_wm_sysmenu (GdkWindow *window, MSG *msg, gint *ret_valp)
|
||||
{
|
||||
@@ -2556,31 +2360,6 @@ gdk_event_translate (MSG *msg,
|
||||
|
||||
API_CALL (GetKeyboardState, (key_state));
|
||||
|
||||
ccount = 0;
|
||||
|
||||
if (msg->wParam == VK_PACKET)
|
||||
{
|
||||
ccount = ToUnicode (VK_PACKET, HIWORD (msg->lParam), key_state, wbuf, 1, 0);
|
||||
if (ccount == 1)
|
||||
{
|
||||
if (wbuf[0] >= 0xD800 && wbuf[0] < 0xDC00)
|
||||
{
|
||||
if (msg->message == WM_KEYDOWN)
|
||||
impl->leading_surrogate_keydown = wbuf[0];
|
||||
else
|
||||
impl->leading_surrogate_keyup = wbuf[0];
|
||||
|
||||
/* don't emit an event */
|
||||
return_val = TRUE;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* wait until an event is created */;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
event = gdk_event_new ((msg->message == WM_KEYDOWN ||
|
||||
msg->message == WM_SYSKEYDOWN) ?
|
||||
GDK_KEY_PRESS : GDK_KEY_RELEASE);
|
||||
@@ -2595,6 +2374,39 @@ gdk_event_translate (MSG *msg,
|
||||
gdk_event_set_device (event, device_manager_win32->core_keyboard);
|
||||
gdk_event_set_source_device (event, device_manager_win32->system_keyboard);
|
||||
gdk_event_set_seat (event, gdk_device_get_seat (device_manager_win32->core_keyboard));
|
||||
|
||||
/* Get the WinAPI translation of the WM_KEY messages to characters.
|
||||
|
||||
The WM_CHAR messages are generated by a previous call to TranslateMessage() and always
|
||||
follow directly after the corresponding WM_KEY* messages.
|
||||
There could be 0 or more WM_CHAR messages following (for example dead keys don't generate
|
||||
WM_CHAR messages - they generate WM_DEAD_CHAR instead, but we are not interested in those
|
||||
messages). */
|
||||
|
||||
if (gdk_event_is_allocated (event)) /* Should always be true */
|
||||
{
|
||||
GdkEventPrivate *event_priv = (GdkEventPrivate*) event;
|
||||
|
||||
MSG msg2;
|
||||
while (PeekMessageW (&msg2, msg->hwnd, 0, 0, 0) && (msg2.message == WM_CHAR || msg2.message == WM_SYSCHAR))
|
||||
{
|
||||
/* The character is encoded in WPARAM as UTF-16. */
|
||||
gunichar2 c = msg2.wParam;
|
||||
|
||||
/* Ignore control sequences like Backspace */
|
||||
if (!g_unichar_iscntrl(c))
|
||||
{
|
||||
/* Append character to translation string. */
|
||||
event_priv->translation_len ++;
|
||||
event_priv->translation = g_realloc (event_priv->translation, event_priv->translation_len * sizeof (event_priv->translation[0]));
|
||||
event_priv->translation[event_priv->translation_len - 1] = c;
|
||||
}
|
||||
|
||||
/* Remove message from queue */
|
||||
GetMessageW (&msg2, msg->hwnd, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (HIWORD (msg->lParam) & KF_EXTENDED)
|
||||
{
|
||||
switch (msg->wParam)
|
||||
@@ -2623,42 +2435,12 @@ gdk_event_translate (MSG *msg,
|
||||
|
||||
build_key_event_state (event, key_state);
|
||||
|
||||
if (msg->wParam == VK_PACKET && ccount == 1)
|
||||
{
|
||||
if (wbuf[0] >= 0xD800 && wbuf[0] < 0xDC00)
|
||||
{
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
else if (wbuf[0] >= 0xDC00 && wbuf[0] < 0xE000)
|
||||
{
|
||||
wchar_t leading;
|
||||
|
||||
if (msg->message == WM_KEYDOWN)
|
||||
leading = impl->leading_surrogate_keydown;
|
||||
else
|
||||
leading = impl->leading_surrogate_keyup;
|
||||
|
||||
event->key.keyval = gdk_unicode_to_keyval ((leading - 0xD800) * 0x400 + wbuf[0] - 0xDC00 + 0x10000);
|
||||
}
|
||||
else
|
||||
{
|
||||
event->key.keyval = gdk_unicode_to_keyval (wbuf[0]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_keymap_translate_keyboard_state (_gdk_win32_display_get_keymap (display),
|
||||
event->key.hardware_keycode,
|
||||
event->key.state,
|
||||
event->key.group,
|
||||
&event->key.keyval,
|
||||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
if (msg->message == WM_KEYDOWN)
|
||||
impl->leading_surrogate_keydown = 0;
|
||||
else
|
||||
impl->leading_surrogate_keyup = 0;
|
||||
gdk_keymap_translate_keyboard_state (_gdk_win32_display_get_keymap (display),
|
||||
event->key.hardware_keycode,
|
||||
event->key.state,
|
||||
event->key.group,
|
||||
&event->key.keyval,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
fill_key_event_string (event);
|
||||
|
||||
@@ -3389,8 +3171,6 @@ gdk_event_translate (MSG *msg,
|
||||
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
{
|
||||
return_val = ensure_stacking_on_window_pos_changing (msg, window);
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
|
||||
|
||||
if (impl->maximizing)
|
||||
@@ -3480,13 +3260,6 @@ gdk_event_translate (MSG *msg,
|
||||
if ((old_state & GDK_WINDOW_STATE_ICONIFIED) !=
|
||||
(new_state & GDK_WINDOW_STATE_ICONIFIED))
|
||||
do_show_window (window, (new_state & GDK_WINDOW_STATE_ICONIFIED));
|
||||
|
||||
|
||||
/* When un-minimizing, make sure we're stacked under any
|
||||
transient-type windows. */
|
||||
if (!(old_state & GDK_WINDOW_STATE_ICONIFIED) &&
|
||||
(new_state & GDK_WINDOW_STATE_ICONIFIED))
|
||||
ensure_stacking_on_unminimize (msg);
|
||||
}
|
||||
|
||||
/* Show, New size or position => configure event */
|
||||
@@ -3968,8 +3741,6 @@ gdk_event_translate (MSG *msg,
|
||||
GDK_NOTE (EVENTS, g_print (" %s thread: %" G_GINT64_FORMAT,
|
||||
msg->wParam ? "YES" : "NO",
|
||||
(gint64) msg->lParam));
|
||||
if (msg->wParam && GDK_WINDOW_IS_MAPPED (window))
|
||||
ensure_stacking_on_activate_app (msg, window);
|
||||
break;
|
||||
case WM_NCHITTEST:
|
||||
/* TODO: pass all messages to DwmDefWindowProc() first! */
|
||||
|
||||
@@ -123,21 +123,34 @@ gdk_win32_gl_context_init (GdkWin32GLContext *self)
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gl_blit_region (GdkWindow *window, cairo_region_t *region)
|
||||
gdk_gl_blit_region (GdkWindow *window,
|
||||
cairo_region_t *region,
|
||||
gboolean use_intel_workaround)
|
||||
{
|
||||
int n_rects, i;
|
||||
int n_rects, i, j;
|
||||
int scale = gdk_window_get_scale_factor (window);
|
||||
int wh = gdk_window_get_height (window);
|
||||
cairo_rectangle_int_t rect;
|
||||
int retries = 0;
|
||||
|
||||
if (use_intel_workaround)
|
||||
retries = 1;
|
||||
|
||||
n_rects = cairo_region_num_rectangles (region);
|
||||
for (i = 0; i < n_rects; i++)
|
||||
|
||||
for (i = 0; i <= retries; i ++)
|
||||
{
|
||||
cairo_region_get_rectangle (region, i, &rect);
|
||||
glScissor (rect.x * scale, (wh - rect.y - rect.height) * scale, rect.width * scale, rect.height * scale);
|
||||
glBlitFramebuffer (rect.x * scale, (wh - rect.y - rect.height) * scale, (rect.x + rect.width) * scale, (wh - rect.y) * scale,
|
||||
rect.x * scale, (wh - rect.y - rect.height) * scale, (rect.x + rect.width) * scale, (wh - rect.y) * scale,
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||
for (j = 0; j < n_rects; j++)
|
||||
{
|
||||
cairo_region_get_rectangle (region, j, &rect);
|
||||
glScissor (rect.x * scale, (wh - rect.y - rect.height) * scale, rect.width * scale, rect.height * scale);
|
||||
glBlitFramebuffer (rect.x * scale, (wh - rect.y - rect.height) * scale, (rect.x + rect.width) * scale, (wh - rect.y) * scale,
|
||||
rect.x * scale, (wh - rect.y - rect.height) * scale, (rect.x + rect.width) * scale, (wh - rect.y) * scale,
|
||||
GL_COLOR_BUFFER_BIT, GL_NEAREST);
|
||||
}
|
||||
|
||||
if (retries > 0 && i < retries)
|
||||
glFlush ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +219,7 @@ _gdk_win32_gl_context_end_frame (GdkGLContext *context,
|
||||
{
|
||||
glDrawBuffer(GL_FRONT);
|
||||
glReadBuffer(GL_BACK);
|
||||
gdk_gl_blit_region (window, painted);
|
||||
gdk_gl_blit_region (window, painted, display->needIntelGLWorkaround);
|
||||
glDrawBuffer(GL_BACK);
|
||||
glFlush();
|
||||
|
||||
@@ -224,7 +237,7 @@ _gdk_win32_gl_context_end_frame (GdkGLContext *context,
|
||||
gboolean force_egl_redraw_all = _get_is_egl_force_redraw (window);
|
||||
|
||||
if (context_win32->do_blit_swap && !force_egl_redraw_all)
|
||||
gdk_gl_blit_region (window, painted);
|
||||
gdk_gl_blit_region (window, painted, FALSE);
|
||||
else if (force_egl_redraw_all)
|
||||
{
|
||||
GdkRectangle rect = {0, 0, gdk_window_get_width (window), gdk_window_get_height (window)};
|
||||
@@ -577,7 +590,9 @@ _gdk_win32_display_init_gl (GdkDisplay *display,
|
||||
|
||||
#ifdef GDK_WIN32_ENABLE_EGL
|
||||
EGLDisplay egl_disp;
|
||||
disable_wgl = (_gdk_gl_flags & GDK_GL_GLES) != 0;
|
||||
|
||||
disable_wgl = ((_gdk_gl_flags & GDK_GL_GLES) != 0) ||
|
||||
display_win32->running_on_arm64;
|
||||
#endif
|
||||
|
||||
if (display_win32->have_wgl
|
||||
@@ -614,10 +629,13 @@ _gdk_win32_display_init_gl (GdkDisplay *display,
|
||||
epoxy_has_wgl_extension (dummy.hdc, "WGL_ARB_pixel_format");
|
||||
display_win32->hasWglARBmultisample =
|
||||
epoxy_has_wgl_extension (dummy.hdc, "WGL_ARB_multisample");
|
||||
display_win32->needIntelGLWorkaround =
|
||||
(g_ascii_strcasecmp (glGetString (GL_VENDOR), "intel") == 0);
|
||||
|
||||
GDK_NOTE (OPENGL,
|
||||
g_print ("WGL API version %d.%d found\n"
|
||||
" - Vendor: %s\n"
|
||||
" - Intel OpenGL workaround: %s\n"
|
||||
" - Checked extensions:\n"
|
||||
"\t* WGL_ARB_pixel_format: %s\n"
|
||||
"\t* WGL_ARB_create_context: %s\n"
|
||||
@@ -627,6 +645,7 @@ _gdk_win32_display_init_gl (GdkDisplay *display,
|
||||
display_win32->gl_version / 10,
|
||||
display_win32->gl_version % 10,
|
||||
glGetString (GL_VENDOR),
|
||||
display_win32->needIntelGLWorkaround ? "yes" : "no",
|
||||
display_win32->hasWglARBPixelFormat ? "yes" : "no",
|
||||
display_win32->hasWglARBCreateContext ? "yes" : "no",
|
||||
display_win32->hasWglEXTSwapControl ? "yes" : "no",
|
||||
|
||||
@@ -559,6 +559,7 @@ enum_monitor (HMONITOR hmonitor,
|
||||
DEVMODEW dm;
|
||||
DWORD i_monitor;
|
||||
DWORD frequency;
|
||||
GdkWin32MonitorRotation orientation;
|
||||
|
||||
memset (&dd, 0, sizeof (dd));
|
||||
dd.cb = sizeof (dd);
|
||||
@@ -577,12 +578,36 @@ enum_monitor (HMONITOR hmonitor,
|
||||
continue;
|
||||
|
||||
dm.dmSize = sizeof (dm);
|
||||
dm.dmDriverExtra = 0;
|
||||
frequency = 0;
|
||||
orientation = GDK_WIN32_MONITOR_ROTATION_UNKNOWN;
|
||||
|
||||
/* Grab refresh rate for this adapter while we're at it */
|
||||
if (EnumDisplaySettingsW (dd.DeviceName, ENUM_CURRENT_SETTINGS, &dm))
|
||||
frequency = dm.dmDisplayFrequency;
|
||||
else
|
||||
frequency = 0;
|
||||
if (EnumDisplaySettingsExW (dd.DeviceName, ENUM_CURRENT_SETTINGS, &dm, 0))
|
||||
{
|
||||
if ((dm.dmFields & DM_DISPLAYORIENTATION) == DM_DISPLAYORIENTATION)
|
||||
{
|
||||
switch (dm.dmDisplayOrientation)
|
||||
{
|
||||
default:
|
||||
case DMDO_DEFAULT:
|
||||
orientation = GDK_WIN32_MONITOR_ROTATION_0;
|
||||
break;
|
||||
case DMDO_90:
|
||||
orientation = GDK_WIN32_MONITOR_ROTATION_90;
|
||||
break;
|
||||
case DMDO_180:
|
||||
orientation = GDK_WIN32_MONITOR_ROTATION_180;
|
||||
break;
|
||||
case DMDO_270:
|
||||
orientation = GDK_WIN32_MONITOR_ROTATION_270;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((dm.dmFields & DM_DISPLAYFREQUENCY) == DM_DISPLAYFREQUENCY)
|
||||
frequency = dm.dmDisplayFrequency;
|
||||
}
|
||||
|
||||
/* Enumerate monitors connected to this display adapter */
|
||||
for (i_monitor = 0; TRUE; i_monitor++)
|
||||
@@ -744,6 +769,7 @@ enum_monitor (HMONITOR hmonitor,
|
||||
* keep remove == TRUE and be removed further up the stack.
|
||||
*/
|
||||
w32mon->remove = FALSE;
|
||||
w32mon->orientation = orientation;
|
||||
|
||||
/* One virtual monitor per display adapter */
|
||||
if (w32mon->madeup)
|
||||
@@ -770,6 +796,58 @@ prune_monitors (EnumMonitorData *data)
|
||||
}
|
||||
}
|
||||
|
||||
const gchar *
|
||||
_gdk_win32_monitor_get_pixel_structure (GdkMonitor *monitor)
|
||||
{
|
||||
GdkWin32Monitor *w32_m;
|
||||
BOOL enabled = TRUE;
|
||||
unsigned int smoothing_orientation = FE_FONTSMOOTHINGORIENTATIONRGB;
|
||||
UINT cleartype = FE_FONTSMOOTHINGCLEARTYPE;
|
||||
|
||||
g_return_val_if_fail (monitor != NULL, NULL);
|
||||
|
||||
w32_m = GDK_WIN32_MONITOR (monitor);
|
||||
|
||||
SystemParametersInfoW (SPI_GETFONTSMOOTHING, 0, &enabled, 0);
|
||||
SystemParametersInfoW (SPI_GETFONTSMOOTHINGTYPE, 0, &cleartype, 0);
|
||||
|
||||
if (!enabled ||
|
||||
(cleartype == FE_FONTSMOOTHINGSTANDARD) ||
|
||||
!SystemParametersInfoW (SPI_GETFONTSMOOTHINGORIENTATION, 0, &smoothing_orientation, 0))
|
||||
return "none";
|
||||
|
||||
if (smoothing_orientation == FE_FONTSMOOTHINGORIENTATIONBGR)
|
||||
switch (w32_m->orientation)
|
||||
{
|
||||
default:
|
||||
case GDK_WIN32_MONITOR_ROTATION_UNKNOWN:
|
||||
return "none";
|
||||
case GDK_WIN32_MONITOR_ROTATION_0:
|
||||
return "bgr";
|
||||
case GDK_WIN32_MONITOR_ROTATION_90:
|
||||
return "vbgr";
|
||||
case GDK_WIN32_MONITOR_ROTATION_180:
|
||||
return "rgb";
|
||||
case GDK_WIN32_MONITOR_ROTATION_270:
|
||||
return "vrgb";
|
||||
}
|
||||
else
|
||||
switch (w32_m->orientation)
|
||||
{
|
||||
default:
|
||||
case GDK_WIN32_MONITOR_ROTATION_UNKNOWN:
|
||||
return "none";
|
||||
case GDK_WIN32_MONITOR_ROTATION_0:
|
||||
return "rgb";
|
||||
case GDK_WIN32_MONITOR_ROTATION_90:
|
||||
return "vrgb";
|
||||
case GDK_WIN32_MONITOR_ROTATION_180:
|
||||
return "bgr";
|
||||
case GDK_WIN32_MONITOR_ROTATION_270:
|
||||
return "vbgr";
|
||||
}
|
||||
}
|
||||
|
||||
GPtrArray *
|
||||
_gdk_win32_display_get_monitor_list (GdkWin32Display *win32_display)
|
||||
{
|
||||
|
||||
@@ -26,6 +26,36 @@
|
||||
|
||||
#include "gdkwin32monitor.h"
|
||||
|
||||
/*
|
||||
* The number is the degrees the display is rotated clockwise
|
||||
* from its natural position.
|
||||
* I.e. most displays will have 0. A normal display
|
||||
* that is rotated by 90 degrees will
|
||||
* have 90. The same display rotated counter-clockwise
|
||||
* will have 270. The same display
|
||||
* rotated by 180 degrees (i.e. upside-down)
|
||||
* will have 180.
|
||||
* Accordingly, 0 mode
|
||||
* fontsmoothing is used as-is - i.e. it is assumed that
|
||||
* subpixel structure is horizontal (ClearType does not support
|
||||
* vertical subpixels; if the display has naturally vertical
|
||||
* subpixel structure, ClearType should be disabled altogether).
|
||||
* In 90 subpixel structure has
|
||||
* its verticality flipped (rgb -> vrgb; bgr -> vbgr).
|
||||
* In 180 subpixel structure is
|
||||
* horizontally flipped (rgb -> bgr; bgr -> rgb).
|
||||
* In 270 subpixel structure is
|
||||
* flipped both horizontally and vertically
|
||||
* (rgb -> vbgr; bgr -> vrgb).
|
||||
*/
|
||||
typedef enum _GdkWin32MonitorRotation {
|
||||
GDK_WIN32_MONITOR_ROTATION_UNKNOWN = 0,
|
||||
GDK_WIN32_MONITOR_ROTATION_0 = 1,
|
||||
GDK_WIN32_MONITOR_ROTATION_90 = 2,
|
||||
GDK_WIN32_MONITOR_ROTATION_180 = 3,
|
||||
GDK_WIN32_MONITOR_ROTATION_270 = 4,
|
||||
} GdkWin32MonitorRotation;
|
||||
|
||||
struct _GdkWin32Monitor
|
||||
{
|
||||
GdkMonitor parent;
|
||||
@@ -36,6 +66,11 @@ struct _GdkWin32Monitor
|
||||
/* Device instance path (used to match GdkWin32Monitor to monitor device) */
|
||||
gchar *instance_path;
|
||||
|
||||
/* Indicates display rotation and its normal proportions.
|
||||
* Used to determine pixel structure for subpixel smoothing.
|
||||
*/
|
||||
GdkWin32MonitorRotation orientation;
|
||||
|
||||
/* TRUE if monitor is made up by us
|
||||
* (this happens when system has logical monitors, but no physical ones).
|
||||
*/
|
||||
@@ -54,4 +89,6 @@ struct _GdkWin32MonitorClass {
|
||||
|
||||
int _gdk_win32_monitor_compare (GdkWin32Monitor *a, GdkWin32Monitor *b);
|
||||
|
||||
const gchar *_gdk_win32_monitor_get_pixel_structure (GdkMonitor *monitor);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -298,7 +298,7 @@ extern UINT _gdk_input_codepage;
|
||||
extern guint _gdk_keymap_serial;
|
||||
|
||||
/* The singleton selection object pointer */
|
||||
GdkWin32Selection *_win32_selection;
|
||||
extern GdkWin32Selection *_win32_selection;
|
||||
|
||||
void _gdk_win32_dnd_do_dragdrop (void);
|
||||
void _gdk_win32_ole2_dnd_property_change (GdkAtom type,
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "gdkproperty.h"
|
||||
#include "gdkselection.h"
|
||||
#include "gdkprivate-win32.h"
|
||||
#include "gdkmonitor-win32.h"
|
||||
#include "gdkwin32.h"
|
||||
|
||||
GdkAtom
|
||||
@@ -368,8 +369,11 @@ _gdk_win32_screen_get_setting (GdkScreen *screen,
|
||||
}
|
||||
else if (strcmp ("gtk-xft-antialias", name) == 0)
|
||||
{
|
||||
GDK_NOTE(MISC, g_print ("gdk_screen_get_setting(\"%s\") : 1\n", name));
|
||||
g_value_set_int (value, 1);
|
||||
BOOL val = TRUE;
|
||||
SystemParametersInfoW (SPI_GETFONTSMOOTHING, 0, &val, 0);
|
||||
g_value_set_int (value, val ? 1 : 0);
|
||||
|
||||
GDK_NOTE(MISC, g_print ("gdk_screen_get_setting(\"%s\") : %u\n", name, val));
|
||||
return TRUE;
|
||||
}
|
||||
else if (strcmp ("gtk-xft-hintstyle", name) == 0)
|
||||
@@ -380,18 +384,11 @@ _gdk_win32_screen_get_setting (GdkScreen *screen,
|
||||
}
|
||||
else if (strcmp ("gtk-xft-rgba", name) == 0)
|
||||
{
|
||||
unsigned int orientation = 0;
|
||||
if (SystemParametersInfoW (SPI_GETFONTSMOOTHINGORIENTATION, 0, &orientation, 0))
|
||||
{
|
||||
if (orientation == FE_FONTSMOOTHINGORIENTATIONRGB)
|
||||
g_value_set_static_string (value, "rgb");
|
||||
else if (orientation == FE_FONTSMOOTHINGORIENTATIONBGR)
|
||||
g_value_set_static_string (value, "bgr");
|
||||
else
|
||||
g_value_set_static_string (value, "none");
|
||||
}
|
||||
else
|
||||
g_value_set_static_string (value, "none");
|
||||
const gchar *rgb_value;
|
||||
GdkMonitor *monitor;
|
||||
monitor = gdk_display_get_monitor (gdk_display_get_default (), 0);
|
||||
rgb_value = _gdk_win32_monitor_get_pixel_structure (monitor);
|
||||
g_value_set_static_string (value, rgb_value);
|
||||
|
||||
GDK_NOTE(MISC, g_print ("gdk_screen_get_setting(\"%s\") : %s\n", name, g_value_get_string (value)));
|
||||
return TRUE;
|
||||
|
||||
@@ -1474,7 +1474,7 @@ show_window_internal (GdkWindow *window,
|
||||
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
|
||||
(window->state & GDK_WINDOW_STATE_ABOVE)?HWND_TOPMOST:HWND_NOTOPMOST,
|
||||
0, 0, 0, 0,
|
||||
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOOWNERZORDER));
|
||||
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1834,7 +1834,7 @@ gdk_win32_window_raise (GdkWindow *window)
|
||||
else
|
||||
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_TOP,
|
||||
0, 0, 0, 0,
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER));
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1851,7 +1851,7 @@ gdk_win32_window_lower (GdkWindow *window)
|
||||
|
||||
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_BOTTOM,
|
||||
0, 0, 0, 0,
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER));
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2910,7 +2910,7 @@ _gdk_win32_window_update_style_bits (GdkWindow *window)
|
||||
rect.right += after.right - before.right;
|
||||
rect.bottom += after.bottom - before.bottom;
|
||||
|
||||
flags = SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOREPOSITION | SWP_NOOWNERZORDER;
|
||||
flags = SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOREPOSITION;
|
||||
|
||||
if (will_be_topmost && !was_topmost)
|
||||
{
|
||||
@@ -5372,7 +5372,7 @@ gdk_win32_window_fullscreen (GdkWindow *window)
|
||||
y - workaround_padding,
|
||||
width + (workaround_padding * 2),
|
||||
height + (workaround_padding * 2),
|
||||
SWP_NOCOPYBITS | SWP_SHOWWINDOW | SWP_NOOWNERZORDER));
|
||||
SWP_NOCOPYBITS | SWP_SHOWWINDOW));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5392,10 +5392,11 @@ gdk_win32_window_unfullscreen (GdkWindow *window)
|
||||
|
||||
impl->hint_flags = fi->hint_flags;
|
||||
SetWindowLong (GDK_WINDOW_HWND (window), GWL_STYLE, fi->style);
|
||||
_gdk_win32_window_invalidate_egl_framebuffer (window);
|
||||
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_NOTOPMOST,
|
||||
fi->r.left, fi->r.top,
|
||||
fi->r.right - fi->r.left, fi->r.bottom - fi->r.top,
|
||||
SWP_NOCOPYBITS | SWP_SHOWWINDOW | SWP_NOOWNERZORDER));
|
||||
SWP_NOCOPYBITS | SWP_SHOWWINDOW));
|
||||
|
||||
g_object_set_data (G_OBJECT (window), "fullscreen-info", NULL);
|
||||
g_free (fi);
|
||||
@@ -5421,7 +5422,7 @@ gdk_win32_window_set_keep_above (GdkWindow *window,
|
||||
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
|
||||
setting ? HWND_TOPMOST : HWND_NOTOPMOST,
|
||||
0, 0, 0, 0,
|
||||
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOOWNERZORDER));
|
||||
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE));
|
||||
}
|
||||
|
||||
gdk_synthesize_window_state (window,
|
||||
@@ -5447,7 +5448,7 @@ gdk_win32_window_set_keep_below (GdkWindow *window,
|
||||
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
|
||||
setting ? HWND_BOTTOM : HWND_NOTOPMOST,
|
||||
0, 0, 0, 0,
|
||||
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOOWNERZORDER));
|
||||
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE));
|
||||
}
|
||||
|
||||
gdk_synthesize_window_state (window,
|
||||
|
||||
@@ -240,14 +240,6 @@ struct _GdkWindowImplWin32
|
||||
HICON hicon_big;
|
||||
HICON hicon_small;
|
||||
|
||||
/* When VK_PACKET sends us a leading surrogate, it's stashed here.
|
||||
* Later, when another VK_PACKET sends a tailing surrogate, we make up
|
||||
* a full unicode character from them, or discard the leading surrogate,
|
||||
* if the next key is not a tailing surrogate.
|
||||
*/
|
||||
wchar_t leading_surrogate_keydown;
|
||||
wchar_t leading_surrogate_keyup;
|
||||
|
||||
/* Window size hints */
|
||||
gint hint_flags;
|
||||
GdkGeometry hints;
|
||||
|
||||
@@ -149,7 +149,7 @@ gdk_x11_window_invalidate_for_new_frame (GdkWindow *window,
|
||||
|
||||
|
||||
invalidate_all = FALSE;
|
||||
if (buffer_age == 0 || buffer_age >= 4)
|
||||
if (buffer_age >= 4)
|
||||
{
|
||||
cairo_rectangle_int_t whole_window = { 0, 0, gdk_window_get_width (window), gdk_window_get_height (window) };
|
||||
|
||||
@@ -163,6 +163,10 @@ gdk_x11_window_invalidate_for_new_frame (GdkWindow *window,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (buffer_age == 0)
|
||||
{
|
||||
invalidate_all = TRUE;
|
||||
}
|
||||
if (buffer_age >= 2)
|
||||
{
|
||||
if (window->old_updated_area[0])
|
||||
|
||||
@@ -3025,12 +3025,29 @@ G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
if (pattern == parent_relative_pattern)
|
||||
{
|
||||
GdkWindow *parent;
|
||||
Window xroot, xparent, *xchildren;
|
||||
guint nxchildren, xparent_depth;
|
||||
XWindowAttributes xattrs;
|
||||
|
||||
if (!XQueryTree (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window),
|
||||
&xroot, &xparent, &xchildren, &nxchildren))
|
||||
{
|
||||
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
|
||||
GDK_WINDOW_XID (window), None);
|
||||
return;
|
||||
}
|
||||
|
||||
if (xchildren)
|
||||
XFree (xchildren);
|
||||
|
||||
if (xparent) {
|
||||
XGetWindowAttributes (GDK_WINDOW_XDISPLAY (window), xparent, &xattrs);
|
||||
xparent_depth = xattrs.depth;
|
||||
}
|
||||
|
||||
/* X throws BadMatch if the parent has a different depth when
|
||||
* using ParentRelative */
|
||||
parent = gdk_window_get_parent (window);
|
||||
if (parent != NULL && window->depth == parent->depth &&
|
||||
if (xparent && window->depth == xparent_depth &&
|
||||
cairo_pattern_status (pattern) == CAIRO_STATUS_SUCCESS)
|
||||
{
|
||||
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
|
||||
|
||||
@@ -510,7 +510,6 @@ gtk_private_h_sources = \
|
||||
gtkiconviewprivate.h \
|
||||
gtkimagedefinitionprivate.h \
|
||||
gtkimageprivate.h \
|
||||
gtkimcontextsimpleprivate.h \
|
||||
gtkimmoduleprivate.h \
|
||||
gtkimcontextsimpleseqs.h \
|
||||
gtkintl.h \
|
||||
@@ -1030,6 +1029,13 @@ gtk_private_h_sources += \
|
||||
gtkprinteroptionwidget.h \
|
||||
gtksearchenginetracker.h
|
||||
|
||||
if HAVE_TRACKER3
|
||||
gtk_private_h_sources += \
|
||||
gtksearchenginetracker3.h
|
||||
gtk_os_unix_c_sources += \
|
||||
gtksearchenginetracker3.c
|
||||
endif
|
||||
|
||||
gtk_c_sources += $(gtk_os_unix_c_sources)
|
||||
endif
|
||||
|
||||
@@ -1421,10 +1427,10 @@ resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir) --gener
|
||||
|
||||
gtkresources.h: gtk.gresource.xml
|
||||
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< \
|
||||
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-header --manual-register
|
||||
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-header --manual-register --internal
|
||||
gtkresources.c: gtk.gresource.xml $(resource_files)
|
||||
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $< \
|
||||
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-source --manual-register
|
||||
--target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-source --manual-register --internal
|
||||
|
||||
gtkprivatetypebuiltins.h: stamp-gtkprivatetypebuiltins.h
|
||||
@true
|
||||
@@ -1520,7 +1526,7 @@ gtk_3_HEADERS_INST = \
|
||||
|
||||
gtk_3_HEADERS_EXCLUDES = dummy
|
||||
|
||||
include $(top_srcdir)/build/Makefile.msvcproj
|
||||
include $(top_srcdir)/win32/Makefile.msvcproj
|
||||
|
||||
if HAVE_INTROSPECTION
|
||||
# Introspection Items for MSVC
|
||||
@@ -1546,11 +1552,11 @@ GTK_MSVC_GIR_CFLAGS = \
|
||||
-DINCLUDE_IM_ti_et \
|
||||
-DINCLUDE_IM_viqr \
|
||||
-DGTK_TEXT_USE_INTERNAL_UNSUPPORTED_API \
|
||||
-I../.. -I../../gtk -I../../gdk
|
||||
-I.. -I../gtk -I../gdk
|
||||
|
||||
INTROSPECTION_INTERMEDIATE_ITEMS = \
|
||||
$(top_builddir)/build/win32/Gtk-3.0.gir.msvc.introspect \
|
||||
$(top_builddir)/build/win32/Gtk_3_0_gir_list
|
||||
$(top_builddir)/win32/Gtk-3.0.gir.msvc.introspect \
|
||||
$(top_builddir)/win32/Gtk_3_0_gir_list
|
||||
|
||||
Gtk_3_0_gir_MSVC_FILES = \
|
||||
$(introspected_pub_headers) \
|
||||
@@ -1565,7 +1571,7 @@ Gtk_3_0_gir_MSVC_LIBS = gtk-3.0 gdk-3.0
|
||||
Gtk_3_0_gir_MSVC_CFLAGS = $(GTK_MSVC_GIR_CFLAGS)
|
||||
Gtk_3_0_gir_MSVC_SCANNERFLAGS = --warn-all --include-uninstalled='./vs$$$$(VSVER)/$$$$(CFG)/$$$$(PLAT)/bin/Gdk-3.0.gir'
|
||||
|
||||
include $(top_srcdir)/build/Makefile.msvc-introspection
|
||||
include $(top_srcdir)/win32/Makefile.msvc-introspection
|
||||
|
||||
else
|
||||
INTROSPECTION_INTERMEDIATE_ITEMS =
|
||||
@@ -1573,8 +1579,8 @@ INTROSPECTION_INTERMEDIATE_ITEMS =
|
||||
endif
|
||||
|
||||
dist-hook: \
|
||||
$(top_builddir)/build/win32/vs9/gtk-3.vcproj \
|
||||
$(top_builddir)/build/win32/vs9/gtk-3.headers \
|
||||
$(top_builddir)/win32/vs9/gtk-3.vcproj \
|
||||
$(top_builddir)/win32/vs9/gtk-3.headers \
|
||||
$(INTROSPECTION_INTERMEDIATE_ITEMS)
|
||||
|
||||
# Install a RC file for the default GTK+ theme, and key themes
|
||||
@@ -1703,27 +1709,10 @@ GTK_UPDATE_ICON_CACHE_MANIFEST = gtk-update-icon-cache.exe.manifest
|
||||
GTK_UPDATE_ICON_CACHE_RC = gtk-update-icon-cache.rc
|
||||
GTK_UPDATE_ICON_CACHE_MANIFEST_OBJECT = gtk-update-icon-cache_manifest.o
|
||||
|
||||
$(GTK_UPDATE_ICON_CACHE_MANIFEST):
|
||||
(echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' ; \
|
||||
echo '<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">' ; \
|
||||
echo ' <assemblyIdentity version="1.0.0.0"' ; \
|
||||
echo ' processorArchitecture="'$(EXE_MANIFEST_ARCHITECTURE)'"' ; \
|
||||
echo ' name="gtk-update-icon-cache.exe"' ; \
|
||||
echo ' type="win32"/>' ; \
|
||||
echo ' <!-- Identify the application security requirements. -->' ; \
|
||||
echo ' <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">' ; \
|
||||
echo ' <security>' ; \
|
||||
echo ' <requestedPrivileges>' ; \
|
||||
echo ' <requestedExecutionLevel' ; \
|
||||
echo ' level="asInvoker"' ; \
|
||||
echo ' uiAccess="false"/>' ; \
|
||||
echo ' </requestedPrivileges>' ; \
|
||||
echo ' </security>' ; \
|
||||
echo ' </trustInfo>' ; \
|
||||
echo '</assembly>' ) >$@
|
||||
$(GTK_UPDATE_ICON_CACHE_MANIFEST): Makefile generate-uac-manifest.py
|
||||
$(PYTHON) $(srcdir)/generate-uac-manifest.py -p=gtk3 -n=gtk-update-icon-cache --pkg-version=$(GTK_VERSION) --output-dir=$(builddir)
|
||||
|
||||
$(GTK_UPDATE_ICON_CACHE_RC):
|
||||
(echo -e '#include <winuser.h>\nCREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST '$(GTK_UPDATE_ICON_CACHE_MANIFEST)) >$@
|
||||
$(GTK_UPDATE_ICON_CACHE_RC): $(GTK_UPDATE_ICON_CACHE_MANIFEST)
|
||||
|
||||
$(GTK_UPDATE_ICON_CACHE_MANIFEST_OBJECT): $(GTK_UPDATE_ICON_CACHE_RC) $(GTK_UPDATE_ICON_CACHE_MANIFEST)
|
||||
$(WINDRES) --input $< --output $@ --output-format=coff
|
||||
@@ -1752,10 +1741,15 @@ EXTRA_DIST += \
|
||||
$(gesture_sources) \
|
||||
$(theme_sources) \
|
||||
$(gsettings_SCHEMAS) \
|
||||
compose-parse.py \
|
||||
emoji/convert-emoji.c \
|
||||
emoji/emoji.json \
|
||||
emoji/emoji1.json \
|
||||
a11y/Makefile.inc \
|
||||
deprecated/Makefile.inc \
|
||||
glade/README.glade \
|
||||
glade/gtk-private-widgets.xml \
|
||||
gtk-compose-lookaside.txt \
|
||||
inspector/Makefile.inc \
|
||||
libgtk3.manifest.in \
|
||||
gtk-win32.rc.body.in \
|
||||
@@ -1765,6 +1759,8 @@ EXTRA_DIST += \
|
||||
gtkwin32embedwidget.c \
|
||||
gtkprint-win32.h \
|
||||
gtkprint-win32.c \
|
||||
gtksearchenginetracker3.c \
|
||||
gtksearchenginetracker3.h \
|
||||
gtksearchenginequartz.h \
|
||||
gtkdbusinterfaces.xml \
|
||||
gtk-keys.css.default \
|
||||
@@ -1779,12 +1775,19 @@ EXTRA_DIST += \
|
||||
meson.build \
|
||||
gen-gtk-gresources-xml.py \
|
||||
gen-rc.py \
|
||||
generate-uac-manifest.py \
|
||||
gentypefuncs.py \
|
||||
a11y/meson.build \
|
||||
deprecated/meson.build \
|
||||
inspector/meson.build \
|
||||
theme/Adwaita/meson.build \
|
||||
theme/HighContrast/meson.build
|
||||
theme/Adwaita/parse-sass.sh \
|
||||
theme/Adwaita/render-assets.sh \
|
||||
theme/HighContrast/assets.svg \
|
||||
theme/HighContrast/assets.txt \
|
||||
theme/HighContrast/meson.build \
|
||||
theme/HighContrast/parse-sass.sh \
|
||||
theme/HighContrast/render-assets.sh
|
||||
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
||||
|
||||
@@ -31,6 +31,7 @@ a11y_h_sources = \
|
||||
a11y/gtknotebookaccessible.h \
|
||||
a11y/gtknotebookpageaccessible.h \
|
||||
a11y/gtkpanedaccessible.h \
|
||||
a11y/gtkplugaccessible.h \
|
||||
a11y/gtkpopoveraccessible.h \
|
||||
a11y/gtkprogressbaraccessible.h \
|
||||
a11y/gtkradiobuttonaccessible.h \
|
||||
@@ -40,6 +41,7 @@ a11y_h_sources = \
|
||||
a11y/gtkscaleaccessible.h \
|
||||
a11y/gtkscalebuttonaccessible.h \
|
||||
a11y/gtkscrolledwindowaccessible.h \
|
||||
a11y/gtksocketaccessible.h \
|
||||
a11y/gtkspinbuttonaccessible.h \
|
||||
a11y/gtkspinneraccessible.h \
|
||||
a11y/gtkstatusbaraccessible.h \
|
||||
@@ -106,6 +108,7 @@ a11y_c_sources = \
|
||||
a11y/gtknotebookaccessible.c \
|
||||
a11y/gtknotebookpageaccessible.c \
|
||||
a11y/gtkpanedaccessible.c \
|
||||
a11y/gtkplugaccessible.c \
|
||||
a11y/gtkpopoveraccessible.c \
|
||||
a11y/gtkprogressbaraccessible.c \
|
||||
a11y/gtkradiobuttonaccessible.c \
|
||||
@@ -115,6 +118,7 @@ a11y_c_sources = \
|
||||
a11y/gtkscaleaccessible.c \
|
||||
a11y/gtkscalebuttonaccessible.c \
|
||||
a11y/gtkscrolledwindowaccessible.c \
|
||||
a11y/gtksocketaccessible.c \
|
||||
a11y/gtkspinbuttonaccessible.c \
|
||||
a11y/gtkspinneraccessible.c \
|
||||
a11y/gtkstatusbaraccessible.c \
|
||||
|
||||
@@ -311,18 +311,10 @@ gtk_notebook_page_accessible_get_extents (AtkComponent *component,
|
||||
label = get_label_from_notebook_page (GTK_NOTEBOOK_PAGE_ACCESSIBLE (component));
|
||||
if (!label)
|
||||
{
|
||||
AtkObject *child;
|
||||
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
|
||||
child = atk_object_ref_accessible_child (ATK_OBJECT (component), 0);
|
||||
if (!child)
|
||||
return;
|
||||
|
||||
atk_component_get_extents (ATK_COMPONENT (child), x, y, NULL, NULL,
|
||||
coord_type);
|
||||
g_object_unref (child);
|
||||
*x = -1;
|
||||
*y = -1;
|
||||
*width = -1;
|
||||
*height = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/* GTK+ - accessibility implementations
|
||||
* Copyright 2019 Samuel Thibault <sthibault@hypra.fr>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtkplugaccessible.h"
|
||||
|
||||
#ifdef GTK_HAVE_ATK_PLUG_SET_CHILD
|
||||
|
||||
/* We can not make GtkPlugAccessible inherit both from GtkContainerAccessible
|
||||
* and GtkPlug, so we make it the atk child of an AtkPlug */
|
||||
|
||||
struct _GtkPlugAccessiblePrivate
|
||||
{
|
||||
AtkObject *accessible_plug;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkPlugAccessible, gtk_plug_accessible, GTK_TYPE_WINDOW_ACCESSIBLE,
|
||||
G_ADD_PRIVATE (GtkPlugAccessible))
|
||||
|
||||
|
||||
static void
|
||||
gtk_plug_accessible_finalize (GObject *object)
|
||||
{
|
||||
GtkPlugAccessible *plug = GTK_PLUG_ACCESSIBLE (object);
|
||||
GtkPlugAccessiblePrivate *priv = plug->priv;
|
||||
|
||||
g_clear_object (&priv->accessible_plug);
|
||||
|
||||
G_OBJECT_CLASS (gtk_plug_accessible_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_plug_accessible_initialize (AtkObject *plug, gpointer data)
|
||||
{
|
||||
AtkObject *atk_plug;
|
||||
|
||||
ATK_OBJECT_CLASS (gtk_plug_accessible_parent_class)->initialize (plug, data);
|
||||
|
||||
atk_plug = atk_plug_new ();
|
||||
atk_plug_set_child (ATK_PLUG (atk_plug), plug);
|
||||
GTK_PLUG_ACCESSIBLE (plug)->priv->accessible_plug = atk_plug;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_plug_accessible_class_init (GtkPlugAccessibleClass *klass) {
|
||||
AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
atk_class->initialize = gtk_plug_accessible_initialize;
|
||||
gobject_class->finalize = gtk_plug_accessible_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_plug_accessible_init (GtkPlugAccessible *plug)
|
||||
{
|
||||
plug->priv = gtk_plug_accessible_get_instance_private (plug);
|
||||
}
|
||||
|
||||
gchar *
|
||||
gtk_plug_accessible_get_id (GtkPlugAccessible *plug)
|
||||
{
|
||||
return atk_plug_get_id (ATK_PLUG (plug->priv->accessible_plug));
|
||||
}
|
||||
|
||||
#endif /* GTK_HAVE_ATK_PLUG_SET_CHILD */
|
||||
@@ -0,0 +1,66 @@
|
||||
/* GTK+ - accessibility implementations
|
||||
* Copyright 2019 Samuel Thibault <sthibault@hypra.fr>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_PLUG_ACCESSIBLE_H__
|
||||
#define __GTK_PLUG_ACCESSIBLE_H__
|
||||
|
||||
#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk-a11y.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/a11y/gtkwindowaccessible.h>
|
||||
|
||||
#if ATK_CHECK_VERSION(2,35,1)
|
||||
|
||||
#define GTK_HAVE_ATK_PLUG_SET_CHILD
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_PLUG_ACCESSIBLE (gtk_plug_accessible_get_type ())
|
||||
#define GTK_PLUG_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PLUG_ACCESSIBLE, GtkPlugAccessible))
|
||||
#define GTK_PLUG_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PLUG_ACCESSIBLE, GtkPlugAccessibleClass))
|
||||
#define GTK_IS_PLUG_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PLUG_ACCESSIBLE))
|
||||
#define GTK_IS_PLUG_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PLUG_ACCESSIBLE))
|
||||
#define GTK_PLUG_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PLUG_ACCESSIBLE, GtkPlugAccessibleClass))
|
||||
|
||||
typedef struct _GtkPlugAccessible GtkPlugAccessible;
|
||||
typedef struct _GtkPlugAccessibleClass GtkPlugAccessibleClass;
|
||||
typedef struct _GtkPlugAccessiblePrivate GtkPlugAccessiblePrivate;
|
||||
|
||||
struct _GtkPlugAccessible
|
||||
{
|
||||
GtkWindowAccessible parent;
|
||||
|
||||
GtkPlugAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkPlugAccessibleClass
|
||||
{
|
||||
GtkWindowAccessibleClass parent_class;
|
||||
};
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_plug_accessible_get_type (void);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gchar *gtk_plug_accessible_get_id (GtkPlugAccessible *plug);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* ATK_CHECK_VERSION(2,35,1) */
|
||||
|
||||
#endif /* __GTK_PLUG_ACCESSIBLE_H__ */
|
||||
@@ -0,0 +1,102 @@
|
||||
/* GTK+ - accessibility implementations
|
||||
* Copyright 2019 Samuel Thibault <sthibault@hypra.fr>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtksocketaccessible.h"
|
||||
|
||||
/* We can not make GtkSocketAccessible inherit both from GtkContainerAccessible
|
||||
* and GtkSocket, so we make it the atk parent of an AtkSocket */
|
||||
|
||||
struct _GtkSocketAccessiblePrivate
|
||||
{
|
||||
AtkObject *accessible_socket;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkSocketAccessible, gtk_socket_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
|
||||
G_ADD_PRIVATE (GtkSocketAccessible))
|
||||
|
||||
static AtkObject*
|
||||
gtk_socket_accessible_ref_child (AtkObject *obj, int i)
|
||||
{
|
||||
GtkSocketAccessible *socket = GTK_SOCKET_ACCESSIBLE (obj);
|
||||
|
||||
if (i != 0)
|
||||
return NULL;
|
||||
|
||||
return g_object_ref (socket->priv->accessible_socket);
|
||||
}
|
||||
|
||||
static int
|
||||
gtk_socket_accessible_get_n_children (AtkObject *obj)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_socket_accessible_finalize (GObject *object)
|
||||
{
|
||||
GtkSocketAccessible *socket = GTK_SOCKET_ACCESSIBLE (object);
|
||||
GtkSocketAccessiblePrivate *priv = socket->priv;
|
||||
|
||||
g_clear_object (&priv->accessible_socket);
|
||||
|
||||
G_OBJECT_CLASS (gtk_socket_accessible_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_socket_accessible_initialize (AtkObject *socket, gpointer data)
|
||||
{
|
||||
AtkObject *atk_socket;
|
||||
|
||||
ATK_OBJECT_CLASS (gtk_socket_accessible_parent_class)->initialize (socket, data);
|
||||
|
||||
atk_socket = atk_socket_new ();
|
||||
|
||||
GTK_SOCKET_ACCESSIBLE(socket)->priv->accessible_socket = atk_socket;
|
||||
atk_object_set_parent (atk_socket, socket);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_socket_accessible_class_init (GtkSocketAccessibleClass *klass)
|
||||
{
|
||||
GtkContainerAccessibleClass *container_class = (GtkContainerAccessibleClass*)klass;
|
||||
AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
container_class->add_gtk = NULL;
|
||||
container_class->remove_gtk = NULL;
|
||||
|
||||
atk_class->initialize = gtk_socket_accessible_initialize;
|
||||
atk_class->get_n_children = gtk_socket_accessible_get_n_children;
|
||||
atk_class->ref_child = gtk_socket_accessible_ref_child;
|
||||
|
||||
gobject_class->finalize = gtk_socket_accessible_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_socket_accessible_init (GtkSocketAccessible *socket)
|
||||
{
|
||||
socket->priv = gtk_socket_accessible_get_instance_private (socket);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_socket_accessible_embed (GtkSocketAccessible *socket, gchar *path)
|
||||
{
|
||||
atk_socket_embed (ATK_SOCKET (socket->priv->accessible_socket), path);
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/* GTK+ - accessibility implementations
|
||||
* Copyright 2019 Samuel Thibault <sthibault@hypra.fr>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_SOCKET_ACCESSIBLE_H__
|
||||
#define __GTK_SOCKET_ACCESSIBLE_H__
|
||||
|
||||
#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk-a11y.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/a11y/gtkcontaineraccessible.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_SOCKET_ACCESSIBLE (gtk_socket_accessible_get_type ())
|
||||
#define GTK_SOCKET_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SOCKET_ACCESSIBLE, GtkSocketAccessible))
|
||||
#define GTK_SOCKET_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_SOCKET_ACCESSIBLE, GtkSocketAccessibleClass))
|
||||
#define GTK_IS_SOCKET_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SOCKET_ACCESSIBLE))
|
||||
#define GTK_IS_SOCKET_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_SOCKET_ACCESSIBLE))
|
||||
#define GTK_SOCKET_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_SOCKET_ACCESSIBLE, GtkSocketAccessibleClass))
|
||||
|
||||
typedef struct _GtkSocketAccessible GtkSocketAccessible;
|
||||
typedef struct _GtkSocketAccessibleClass GtkSocketAccessibleClass;
|
||||
typedef struct _GtkSocketAccessiblePrivate GtkSocketAccessiblePrivate;
|
||||
|
||||
struct _GtkSocketAccessible
|
||||
{
|
||||
GtkContainerAccessible parent;
|
||||
|
||||
GtkSocketAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkSocketAccessibleClass
|
||||
{
|
||||
GtkContainerAccessibleClass parent_class;
|
||||
};
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gtk_socket_accessible_get_type (void);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_socket_accessible_embed (GtkSocketAccessible *socket, gchar *path);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_SOCKET_ACCESSIBLE_H__ */
|
||||
@@ -1309,6 +1309,99 @@ gtk_text_view_accessible_set_selection (AtkText *text,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_text_view_accessible_scroll_substring_to(AtkText *text,
|
||||
gint start_offset,
|
||||
gint end_offset,
|
||||
AtkScrollType type)
|
||||
{
|
||||
GtkTextView *view;
|
||||
GtkWidget *widget;
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter iter;
|
||||
gdouble xalign = -1.0, yalign = -1.0;
|
||||
gboolean use_align = TRUE;
|
||||
gint offset, rtl = 0;
|
||||
|
||||
if (end_offset < start_offset)
|
||||
return FALSE;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
|
||||
if (widget == NULL)
|
||||
return FALSE;
|
||||
|
||||
view = GTK_TEXT_VIEW (widget);
|
||||
buffer = gtk_text_view_get_buffer (view);
|
||||
|
||||
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
|
||||
rtl = 1;
|
||||
|
||||
/*
|
||||
* Opportunistically pick which offset should be used to calculate
|
||||
* the scrolling factor.
|
||||
*
|
||||
* Considering only an extremity of the substring is good enough when
|
||||
* the selected string doesn't include line break and isn't larger than
|
||||
* the visible rectangle.
|
||||
*/
|
||||
switch (type)
|
||||
{
|
||||
case ATK_SCROLL_TOP_LEFT:
|
||||
offset = (rtl) ? end_offset : start_offset;
|
||||
xalign = 0.0;
|
||||
yalign = 0.0;
|
||||
break;
|
||||
case ATK_SCROLL_BOTTOM_RIGHT:
|
||||
offset = (rtl) ? start_offset : end_offset;
|
||||
xalign = 1.0;
|
||||
yalign = 1.0;
|
||||
break;
|
||||
case ATK_SCROLL_TOP_EDGE:
|
||||
offset = start_offset;
|
||||
yalign = 0.0;
|
||||
break;
|
||||
case ATK_SCROLL_BOTTOM_EDGE:
|
||||
offset = end_offset;
|
||||
yalign = 1.0;
|
||||
break;
|
||||
case ATK_SCROLL_LEFT_EDGE:
|
||||
offset = (rtl) ? end_offset : start_offset;
|
||||
xalign = 0.0;
|
||||
break;
|
||||
case ATK_SCROLL_RIGHT_EDGE:
|
||||
offset = (rtl) ? start_offset : end_offset;
|
||||
xalign = 1.0;
|
||||
break;
|
||||
case ATK_SCROLL_ANYWHERE:
|
||||
offset = start_offset;
|
||||
use_align = FALSE;
|
||||
xalign = yalign = 0.0;
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gtk_text_buffer_get_iter_at_offset (buffer, &iter, offset);
|
||||
|
||||
/* Get current iter location to be able to scroll in a single direction. */
|
||||
if (use_align && (xalign == -1.0 || yalign == -1.0))
|
||||
{
|
||||
GdkRectangle rect, irect;
|
||||
|
||||
gtk_text_view_get_visible_rect (view, &rect);
|
||||
gtk_text_view_get_iter_location (view, &iter, &irect);
|
||||
|
||||
if (xalign == -1.0)
|
||||
xalign = ((gdouble) (irect.x - rect.x)) / (rect.width - 1);
|
||||
if (yalign == -1.0)
|
||||
yalign = ((gdouble) (irect.y - rect.y)) / (rect.height - 1);
|
||||
}
|
||||
|
||||
gtk_text_view_scroll_to_iter (view, &iter, 0, use_align, xalign, yalign);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
atk_text_interface_init (AtkTextIface *iface)
|
||||
{
|
||||
@@ -1329,6 +1422,7 @@ atk_text_interface_init (AtkTextIface *iface)
|
||||
iface->set_selection = gtk_text_view_accessible_set_selection;
|
||||
iface->get_run_attributes = gtk_text_view_accessible_get_run_attributes;
|
||||
iface->get_default_attributes = gtk_text_view_accessible_get_default_attributes;
|
||||
iface->scroll_substring_to = gtk_text_view_accessible_scroll_substring_to;
|
||||
}
|
||||
|
||||
/* atkeditabletext.h */
|
||||
|
||||
@@ -34,6 +34,7 @@ a11y_sources = files(
|
||||
'gtknotebookaccessible.c',
|
||||
'gtknotebookpageaccessible.c',
|
||||
'gtkpanedaccessible.c',
|
||||
'gtkplugaccessible.c',
|
||||
'gtkpopoveraccessible.c',
|
||||
'gtkprogressbaraccessible.c',
|
||||
'gtkradiobuttonaccessible.c',
|
||||
@@ -43,6 +44,7 @@ a11y_sources = files(
|
||||
'gtkscaleaccessible.c',
|
||||
'gtkscalebuttonaccessible.c',
|
||||
'gtkscrolledwindowaccessible.c',
|
||||
'gtksocketaccessible.c',
|
||||
'gtkspinbuttonaccessible.c',
|
||||
'gtkspinneraccessible.c',
|
||||
'gtkstatusbaraccessible.c',
|
||||
@@ -90,6 +92,7 @@ a11y_headers = files(
|
||||
'gtknotebookaccessible.h',
|
||||
'gtknotebookpageaccessible.h',
|
||||
'gtkpanedaccessible.h',
|
||||
'gtkplugaccessible.h',
|
||||
'gtkpopoveraccessible.h',
|
||||
'gtkprogressbaraccessible.h',
|
||||
'gtkradiobuttonaccessible.h',
|
||||
@@ -99,6 +102,7 @@ a11y_headers = files(
|
||||
'gtkscaleaccessible.h',
|
||||
'gtkscalebuttonaccessible.h',
|
||||
'gtkscrolledwindowaccessible.h',
|
||||
'gtksocketaccessible.h',
|
||||
'gtkspinbuttonaccessible.h',
|
||||
'gtkspinneraccessible.h',
|
||||
'gtkstatusbaraccessible.h',
|
||||
|
||||
@@ -55,35 +55,6 @@ parse_code (GVariantBuilder *b,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static const char *blacklist[] = {
|
||||
"child",
|
||||
"adult",
|
||||
"older adult",
|
||||
"woman with headscarf",
|
||||
"bearded person",
|
||||
"breast-feeding",
|
||||
"mage",
|
||||
"fairy",
|
||||
"vampire",
|
||||
"merperson",
|
||||
"merman",
|
||||
"mermaid",
|
||||
" elf", // avoid matching selfie
|
||||
"genie",
|
||||
"zombie",
|
||||
"in steamy room",
|
||||
"climbing",
|
||||
"in lotus position",
|
||||
"person in bed",
|
||||
"man in suit levitating",
|
||||
"horse racing",
|
||||
"snowboarder",
|
||||
"golfing",
|
||||
"love-you gesture",
|
||||
"palms up together",
|
||||
NULL
|
||||
};
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
@@ -171,18 +142,6 @@ main (int argc, char *argv[])
|
||||
name = json_object_get_string_member (obj, "name");
|
||||
code = g_strdup (json_object_get_string_member (obj, "code"));
|
||||
|
||||
if (strcmp (name, "world map") == 0)
|
||||
continue;
|
||||
|
||||
skip = FALSE;
|
||||
for (j = 0; blacklist[j]; j++)
|
||||
{
|
||||
if (strstr (name, blacklist[j]) != 0)
|
||||
skip = TRUE;
|
||||
}
|
||||
if (skip)
|
||||
continue;
|
||||
|
||||
has_variations = FALSE;
|
||||
while (i < length)
|
||||
{
|
||||
|
||||
@@ -114,3 +114,23 @@ trunc (double x)
|
||||
return (x > 0 ? floor (x) : ceil (x));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DECL_ISNAN
|
||||
/* it seems of the supported compilers only
|
||||
* MSVC does not have isnan(), but it does
|
||||
* have _isnan() which does the same as isnan()
|
||||
*/
|
||||
static inline gboolean
|
||||
isnan (double x)
|
||||
{
|
||||
return _isnan (x);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FMIN
|
||||
static inline double
|
||||
fmin (double x, double y)
|
||||
{
|
||||
return x < y ? x : y;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
This script generates a Windows manifest file and optionally a resource file to
|
||||
determine whether a specified program requires UAC elevation
|
||||
"""
|
||||
|
||||
import os
|
||||
import argparse
|
||||
|
||||
DOMAIN_NAME='gnome'
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description=__doc__)
|
||||
parser.add_argument('-p', '--package', required=True,
|
||||
help='package name of the executable')
|
||||
parser.add_argument('-n', '--name', required=True,
|
||||
help='name of executable')
|
||||
parser.add_argument('--pkg-version', required=True, dest='version',
|
||||
help='version of package')
|
||||
parser.add_argument('--require-admin', action='store_true', dest='admin',
|
||||
default=False,
|
||||
help='require admin access to application')
|
||||
parser.add_argument('--input-resource-file', dest='resource',
|
||||
default=None,
|
||||
help='existing .rc file to embed UAC manifest (do not generate a new .rc file), must have included winuser.h in it')
|
||||
parser.add_argument('--output-dir', dest='outdir',
|
||||
default=None,
|
||||
help='directory to output resulting files')
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.resource is not None:
|
||||
if not os.path.isfile(args.resource):
|
||||
raise FileNotFoundError("Specified resource file '%s' does not exist" % args.resource)
|
||||
|
||||
generate_manifest(args.package, args.name, args.version, args.admin, args.outdir)
|
||||
write_rc_file(args.name, args.resource, args.outdir)
|
||||
|
||||
def generate_manifest(package, name, version, admin, outdir):
|
||||
if version.count('.') == 0:
|
||||
manifest_package_version = version + '.0.0.0'
|
||||
elif version.count('.') == 1:
|
||||
manifest_package_version = version + '.0.0'
|
||||
elif version.count('.') == 2:
|
||||
manifest_package_version = version + '.0'
|
||||
elif version.count('.') == 3:
|
||||
manifest_package_version = version
|
||||
else:
|
||||
parts = version.split('.')
|
||||
manifest_package_version = ''
|
||||
for x in (0, 1, 2, 3):
|
||||
if x == 0:
|
||||
manifest_package_version += parts[x]
|
||||
else:
|
||||
manifest_package_version += '.' + parts[x]
|
||||
|
||||
if outdir is not None:
|
||||
output_file_base_name = os.path.join(outdir, name)
|
||||
else:
|
||||
output_file_base_name = name
|
||||
|
||||
outfile = open(output_file_base_name + '.exe.manifest', 'w+')
|
||||
outfile.write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n')
|
||||
outfile.write('<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">\n')
|
||||
outfile.write(' <assemblyIdentity version="%s"\n' % manifest_package_version)
|
||||
outfile.write(' processorArchitecture="*"\n')
|
||||
outfile.write(' name="%s.%s.%s.exe"\n' % (DOMAIN_NAME, package, name))
|
||||
outfile.write(' type="win32" />\n')
|
||||
outfile.write(' <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">\n')
|
||||
outfile.write(' <security>\n')
|
||||
outfile.write(' <requestedPrivileges>\n')
|
||||
outfile.write(' <requestedExecutionLevel\n')
|
||||
|
||||
if admin:
|
||||
outfile.write(' level="requireAdministrator"\n')
|
||||
else:
|
||||
outfile.write(' level="asInvoker"\n')
|
||||
|
||||
outfile.write(' uiAccess="false" />\n')
|
||||
outfile.write(' </requestedPrivileges>\n')
|
||||
outfile.write(' </security>\n')
|
||||
outfile.write(' </trustInfo>\n')
|
||||
outfile.write('</assembly>\n')
|
||||
outfile.close()
|
||||
|
||||
def write_rc_file(name, resource, outdir):
|
||||
if outdir is not None:
|
||||
output_file_base_name = os.path.join(outdir, name)
|
||||
else:
|
||||
output_file_base_name = name
|
||||
|
||||
if resource is None:
|
||||
outfile = open(output_file_base_name + '.rc', 'w+')
|
||||
outfile.write('#include <winuser.h>')
|
||||
else:
|
||||
if resource != output_file_base_name + '.rc':
|
||||
outfile = open(output_file_base_name + '.rc', 'w+')
|
||||
else:
|
||||
outfile = open(output_file_base_name + '.final.rc', 'w+')
|
||||
srcfile = open(resource, 'r')
|
||||
outfile.write(srcfile.read())
|
||||
srcfile.close()
|
||||
|
||||
outfile.write('\n')
|
||||
outfile.write('CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "%s.exe.manifest"' % name)
|
||||
outfile.close()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,6 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
@@ -14,8 +12,8 @@
|
||||
viewBox="0 0 64 64.000001"
|
||||
id="svg6535"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="pinch.svg">
|
||||
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
|
||||
sodipodi:docname="gesture-pinch-symbolic.svg">
|
||||
<defs
|
||||
id="defs6537" />
|
||||
<sodipodi:namedview
|
||||
@@ -26,8 +24,8 @@
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="-28.712216"
|
||||
inkscape:cy="21.555733"
|
||||
inkscape:cx="52.173983"
|
||||
inkscape:cy="33.196155"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
@@ -37,10 +35,10 @@
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-width="5120"
|
||||
inkscape:window-height="1376"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:object-paths="true"
|
||||
inkscape:snap-intersection-paths="true"
|
||||
@@ -48,7 +46,8 @@
|
||||
inkscape:snap-nodes="true"
|
||||
inkscape:snap-bbox="false"
|
||||
inkscape:bbox-paths="true"
|
||||
inkscape:bbox-nodes="true">
|
||||
inkscape:bbox-nodes="true"
|
||||
inkscape:document-rotation="0">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid4193" />
|
||||
@@ -72,9 +71,10 @@
|
||||
transform="translate(180,-470.14793)">
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="M 40 8 C 37.784003 8 36 9.8667876 36 12.185547 L 36 36 L 35 36 L 35 29.185547 C 35 29.022886 34.97217 28.868661 34.955078 28.710938 A 4.0004 4.0004 0 0 0 32.398438 24.994141 L 27.960938 23.253906 C 27.578317 18.647747 23.701182 15 19 15 C 14.04721 15 10 19.0472 10 24 C 10 25.418791 10.341256 26.758764 10.931641 27.955078 C 6.0103696 27.99252 2 32.021431 2 36.951172 C 2 41.903972 6.04721 45.951172 11 45.951172 C 11.65701 45.951172 12.296258 45.87534 12.914062 45.740234 L 22 57 L 31 57 L 33.097656 57 L 58 57 C 60.215997 57 62 55.133212 62 52.814453 L 62 40.185547 L 62 31.185547 C 62 28.866788 60.215997 27 58 27 C 55.784003 27 54 28.866788 54 31.185547 L 54 36 L 53 36 L 53 25.185547 C 53 22.866788 51.215997 21 49 21 C 46.784003 21 45 22.866788 45 25.185547 L 45 36 L 44 36 L 44 12.185547 C 44 9.8667876 42.215997 8 40 8 z M 19 18 C 21.608824 18 23.804048 19.639507 24.636719 21.949219 L 20.414062 20.291016 A 4.0004 4.0004 0 0 0 18.851562 19.994141 A 4.0004 4.0004 0 0 0 17.492188 27.738281 L 21.666016 29.376953 C 20.863524 29.772856 19.960933 30 19 30 C 15.66853 30 13 27.33148 13 24 C 13 20.66852 15.66853 18 19 18 z M 24.996094 30.683594 L 27 31.470703 L 27 40.185547 L 27 42.535156 L 22.605469 44.484375 L 19.25 40.533203 C 19.730663 39.433901 20 38.223149 20 36.951172 C 20 35.532014 19.659028 34.192639 19.068359 32.996094 C 21.343367 32.978785 23.41661 32.101557 24.996094 30.683594 z M 11 30.951172 C 14.33147 30.951172 17 33.619692 17 36.951172 C 17 37.24237 16.97303 37.526912 16.933594 37.806641 L 14.105469 34.478516 C 13.349589 33.519886 12.197352 32.958868 10.976562 32.955078 C 7.575713 32.943978 5.7130814 36.912434 7.8945312 39.521484 L 10.648438 42.933594 C 7.4835407 42.75281 5 40.164051 5 36.951172 C 5 33.619692 7.66853 30.951172 11 30.951172 z "
|
||||
d="m 40,16 c -2.215997,0 -4,1.866788 -4,4.185547 V 36 h -1 v -6.814453 c 0,-0.162661 -0.02783,-0.316886 -0.04492,-0.474609 -0.0058,-1.647124 -1.020514,-3.12235 -2.55664,-3.716797 l -4.4375,-1.740235 C 27.578317,18.647747 23.701182,15 19,15 c -4.95279,0 -9,4.0472 -9,9 0,1.418791 0.341256,2.758764 0.931641,3.955078 C 6.0103696,27.99252 2,32.021431 2,36.951172 c 0,4.9528 4.04721,9 9,9 0.65701,0 1.296258,-0.07583 1.914062,-0.210938 L 22,57 H 31 33.097656 58 c 2.215997,0 4,-1.866788 4,-4.185547 v -12.628906 -11 C 62,26.866788 60.215997,25 58,25 c -2.215997,0 -4,1.866788 -4,4.185547 V 36 H 53 V 23.185547 C 53,20.866788 51.215997,19 49,19 c -2.215997,0 -4,1.866788 -4,4.185547 V 36 H 44 V 20.185547 C 44,17.866788 42.215997,16 40,16 Z m -21,2 c 2.608824,0 4.804048,1.639507 5.636719,3.949219 l -4.222657,-1.658203 c -0.495714,-0.202539 -1.027046,-0.303492 -1.5625,-0.296875 -4.422659,0.05488 -5.498941,6.186285 -1.359374,7.74414 l 4.173828,1.638672 C 20.863524,29.772856 19.960933,30 19,30 c -3.33147,0 -6,-2.66852 -6,-6 0,-3.33148 2.66853,-6 6,-6 z M 24.996094,30.683594 27,31.470703 v 8.714844 2.349609 L 22.605469,44.484375 19.25,40.533203 C 19.730663,39.433901 20,38.223149 20,36.951172 c 0,-1.419158 -0.340972,-2.758533 -0.931641,-3.955078 2.275008,-0.01731 4.348251,-0.894537 5.927735,-2.3125 z M 11,30.951172 c 3.33147,0 6,2.66852 6,6 0,0.291198 -0.02697,0.57574 -0.06641,0.855469 l -2.828125,-3.328125 c -0.75588,-0.95863 -1.908117,-1.519648 -3.128907,-1.523438 -3.400849,-0.0111 -5.2634806,3.957356 -3.0820308,6.566406 l 2.7539068,3.41211 C 7.4835407,42.75281 5,40.164051 5,36.951172 c 0,-3.33148 2.66853,-6 6,-6 z"
|
||||
transform="translate(-180,470.14793)"
|
||||
id="rect6515" />
|
||||
id="rect6515"
|
||||
sodipodi:nodetypes="ssccscccsscssccccsscsssccsssccssscccccsssccccccsccsscccccss" />
|
||||
<rect
|
||||
rx="3.999995"
|
||||
ry="4.1854858"
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1008 B |
@@ -1,6 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
@@ -14,8 +12,8 @@
|
||||
viewBox="0 0 64.000001 64.000001"
|
||||
id="svg4317"
|
||||
version="1.1"
|
||||
inkscape:version="0.91 r13725"
|
||||
sodipodi:docname="stretch.svg">
|
||||
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
|
||||
sodipodi:docname="gesture-stretch-symbolic.svg">
|
||||
<defs
|
||||
id="defs4319" />
|
||||
<sodipodi:namedview
|
||||
@@ -25,22 +23,29 @@
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="8.9492826"
|
||||
inkscape:cy="17.544631"
|
||||
inkscape:zoom="5.6568542"
|
||||
inkscape:cx="35.411191"
|
||||
inkscape:cy="34.587503"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
units="px"
|
||||
inkscape:showpageshadow="false"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-width="5120"
|
||||
inkscape:window-height="1376"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1">
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:document-rotation="0"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid9205" />
|
||||
<sodipodi:guide
|
||||
position="129.04699,44.731341"
|
||||
orientation="0,-1"
|
||||
id="guide848" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata4322">
|
||||
@@ -61,9 +66,10 @@
|
||||
transform="translate(0,-988.3622)">
|
||||
<path
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
d="M 25 8 C 20.047207 8 16 12.0472 16 17 C 16 21.849398 19.882333 25.820253 24.693359 25.984375 L 27 30.894531 L 27 41.185547 L 27 43.494141 L 20.464844 44.285156 L 19.414062 43.158203 C 19.786753 42.17281 20 41.112337 20 40 C 20 35.0472 15.952793 31 11 31 C 6.0472067 31 2 35.0472 2 40 C 2 44.9528 6.0472067 49 11 49 C 11.857115 49 12.684113 48.870665 13.470703 48.644531 L 22 58 L 31 58 L 35 58 L 58 58 C 60.215997 58 62 56.133212 62 53.814453 L 62 41.185547 L 62 32.185547 C 62 29.866788 60.215997 28 58 28 C 55.784003 28 54 29.866788 54 32.185547 L 54 37 L 53 37 L 53 26.185547 C 53 23.866788 51.215997 22 49 22 C 46.784003 22 45 23.866788 45 26.185547 L 45 37 L 44 37 L 44 13.185547 C 44 10.866788 42.215997 9 40 9 C 37.784003 9 36 10.866788 36 13.185547 L 36 37 L 35 37 L 35 30.185547 C 35 30.18084 34.998062 30.176578 34.998047 30.171875 A 4.0004 4.0004 0 0 0 34.621094 28.300781 L 31.974609 22.667969 C 33.238019 21.117771 34 19.145357 34 17 C 34 12.0472 29.952793 8 25 8 z M 25 11 C 28.331471 11 31 13.6686 31 17 C 31 17.882507 30.807929 18.714615 30.470703 19.466797 L 29.060547 16.462891 A 4.1028752 3.9987371 0 0 0 25 13.001953 A 4.1028752 3.9987371 0 0 0 24.826172 13.007812 A 4.0004 4.0004 0 0 0 20.896484 16.998047 A 4.1028752 3.9987371 0 0 1 20.896484 17 A 4.1028752 3.9987371 0 0 0 20.898438 17.027344 A 4.0004 4.0004 0 0 0 21.298828 18.755859 L 23.15625 22.710938 C 20.73678 21.938685 19 19.686937 19 17 C 19 13.6686 21.668529 11 25 11 z M 11 34 C 14.331471 34 17 36.6686 17 40 C 17 40.182439 16.988332 40.36093 16.972656 40.539062 L 13.964844 37.3125 C 13.238574 36.5117 12.219112 36.038953 11.138672 36.001953 C 7.5520017 35.879253 5.6304813 40.176278 8.1132812 42.767578 L 11.056641 45.998047 C 11.037592 45.998222 11.019093 46 11 46 C 7.6685289 46 5 43.3315 5 40 C 5 36.6686 7.6685289 34 11 34 z "
|
||||
d="m 25,8 c -4.952793,0 -9,4.0472 -9,9 0,4.849398 3.882333,8.820253 8.693359,8.984375 L 27,30.894531 v 10.291016 2.308594 l -6.535156,0.791015 -1.050782,-1.126953 C 19.786753,42.17281 20,41.112337 20,40 c 0,-4.9528 -4.047207,-9 -9,-9 -4.9527933,0 -9,4.0472 -9,9 0,4.9528 4.0472067,9 9,9 0.857115,0 1.684113,-0.129335 2.470703,-0.355469 L 22,58 h 9 4 23 c 2.215997,0 4,-1.866788 4,-4.185547 v -12.628906 -9 C 62,29.866788 60.215997,28 58,28 c -2.215997,0 -4,1.866788 -4,4.185547 V 37 H 53 V 23.301664 c 0,-2.318759 -1.784003,-4.185547 -4,-4.185547 -2.215997,0 -4,1.866788 -4,4.185547 V 37 H 44 V 19.185547 C 44,16.866788 42.215997,15 40,15 c -2.215997,0 -4,1.866788 -4,4.185547 V 37 h -1 v -6.814453 c 0,-0.0047 -0.0019,-0.009 -0.002,-0.01367 0.02716,-0.644977 -0.102172,-1.286946 -0.376953,-1.871094 L 31.974609,22.667969 C 33.238019,21.117771 34,19.145357 34,17 34,12.0472 29.952793,8 25,8 Z m 0,3 c 3.331471,0 6,2.6686 6,6 0,0.882507 -0.192071,1.714615 -0.529297,2.466797 L 29.060547,16.462891 C 28.784734,14.482317 27.050784,13.004414 25,13.001953 c -0.05798,7.56e-4 -0.115934,0.0027 -0.173828,0.0059 -2.177747,0.03849 -3.924494,1.812154 -3.929688,3.990235 V 17 c 6.19e-4,0.0091 0.0013,0.01823 0.002,0.02734 0.0024,0.598878 0.139225,1.189577 0.40039,1.728515 l 1.857422,3.955079 C 20.73678,21.938685 19,19.686937 19,17 c 0,-3.3314 2.668529,-6 6,-6 z M 11,34 c 3.331471,0 6,2.6686 6,6 0,0.182439 -0.01167,0.36093 -0.02734,0.539062 L 13.964844,37.3125 c -0.72627,-0.8008 -1.745732,-1.273547 -2.826172,-1.310547 -3.5866703,-0.1227 -5.5081907,4.174325 -3.0253908,6.765625 l 2.9433598,3.230469 C 11.037592,45.998222 11.019093,46 11,46 7.6685289,46 5,43.3315 5,40 5,36.6686 7.6685289,34 11,34 Z"
|
||||
transform="translate(0,988.3622)"
|
||||
id="rect4249" />
|
||||
id="rect4249"
|
||||
sodipodi:nodetypes="ssccccccssssccccsscsssccsssccsssccscccssssccccsccccsssscccccsss" />
|
||||
<rect
|
||||
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
|
||||
id="rect7301"
|
||||
|
||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1019 B |
@@ -57,6 +57,7 @@
|
||||
#include <gtk/a11y/gtkmenushellaccessible.h>
|
||||
#include <gtk/a11y/gtknotebookaccessible.h>
|
||||
#include <gtk/a11y/gtknotebookpageaccessible.h>
|
||||
#include <gtk/a11y/gtkplugaccessible.h>
|
||||
#include <gtk/a11y/gtkpopoveraccessible.h>
|
||||
#include <gtk/a11y/gtkpanedaccessible.h>
|
||||
#include <gtk/a11y/gtkprogressbaraccessible.h>
|
||||
@@ -67,6 +68,7 @@
|
||||
#include <gtk/a11y/gtkscaleaccessible.h>
|
||||
#include <gtk/a11y/gtkscalebuttonaccessible.h>
|
||||
#include <gtk/a11y/gtkscrolledwindowaccessible.h>
|
||||
#include <gtk/a11y/gtksocketaccessible.h>
|
||||
#include <gtk/a11y/gtkspinbuttonaccessible.h>
|
||||
#include <gtk/a11y/gtkspinneraccessible.h>
|
||||
#include <gtk/a11y/gtkstackaccessible.h>
|
||||
|
||||
@@ -59,95 +59,29 @@
|
||||
unbind "<shift><ctrl>a";
|
||||
}
|
||||
|
||||
@binding-set gtk-mac-file-chooser
|
||||
@binding-set gtk-mac-cmd-arrows
|
||||
{
|
||||
bind "<meta>v" { "location-popup-on-paste" () };
|
||||
unbind "<ctrl>v";
|
||||
|
||||
bind "<meta><shift>G" { "location-popup" () };
|
||||
bind "<meta><shift>H" { "home-folder" () };
|
||||
bind "<meta>Up" { "up-folder" () };
|
||||
bind "<meta>Left" { "move-cursor" (paragraph-ends, -1, 0) };
|
||||
bind "<meta>KP_Left" { "move-cursor" (paragraph-ends, -1, 0) };
|
||||
bind "<shift><meta>Left" { "move-cursor" (paragraph-ends, -1, 1) };
|
||||
bind "<shift><meta>KP_Left" { "move-cursor" (paragraph-ends, -1, 1) };
|
||||
bind "<meta>Right" { "move-cursor" (paragraph-ends, 1, 0) };
|
||||
bind "<meta>KP_Right" { "move-cursor" (paragraph-ends, 1, 0) };
|
||||
bind "<shift><meta>Right" { "move-cursor" (paragraph-ends, 1, 1) };
|
||||
bind "<shift><meta>KP_Right" { "move-cursor" (paragraph-ends, 1, 1) };
|
||||
}
|
||||
|
||||
@binding-set gtk-mac-tree-view
|
||||
@binding-set gtk-mac-emacs-like
|
||||
{
|
||||
bind "<meta>a" { "select-all" () };
|
||||
bind "<shift><meta>a" { "unselect-all" () };
|
||||
bind "<meta>f" { "start-interactive-search" () };
|
||||
bind "<meta>F" { "start-interactive-search" () };
|
||||
unbind "<ctrl>a";
|
||||
unbind "<shift><ctrl>a";
|
||||
unbind "<ctrl>f";
|
||||
unbind "<ctrl>F";
|
||||
}
|
||||
bind "<ctrl>a" { "move-cursor" (paragraph-ends, -1, 0) };
|
||||
bind "<shift><ctrl>a" { "move-cursor" (paragraph-ends, -1, 1) };
|
||||
bind "<ctrl>e" { "move-cursor" (paragraph-ends, 1, 0) };
|
||||
bind "<shift><ctrl>e" { "move-cursor" (paragraph-ends, 1, 1) };
|
||||
|
||||
@binding-set gtk-mac-icon-view
|
||||
{
|
||||
bind "<meta>a" { "select-all" () };
|
||||
bind "<shift><meta>a" { "unselect-all" () };
|
||||
unbind "<ctrl>a";
|
||||
unbind "<shift><ctrl>a";
|
||||
}
|
||||
|
||||
@binding-set gtk-mac-alt-arrows
|
||||
{
|
||||
bind "<alt>Right" { "move-cursor" (words, 1, 0) };
|
||||
bind "<alt>KP_Right" { "move-cursor" (words, 1, 0) };
|
||||
bind "<alt>Left" { "move-cursor" (words, -1, 0) };
|
||||
bind "<alt>KP_Left" { "move-cursor" (words, -1, 0) };
|
||||
bind "<shift><alt>Right" { "move-cursor" (words, 1, 1) };
|
||||
bind "<shift><alt>KP_Right" { "move-cursor" (words, 1, 1) };
|
||||
bind "<shift><alt>Left" { "move-cursor" (words, -1, 1) };
|
||||
bind "<shift><alt>KP_Left" { "move-cursor" (words, -1, 1) };
|
||||
}
|
||||
|
||||
@binding-set gtk-mac-alt-delete
|
||||
{
|
||||
bind "<alt>Delete" { "delete-from-cursor" (word-ends, 1) };
|
||||
bind "<alt>KP_Delete" { "delete-from-cursor" (word-ends, 1) };
|
||||
bind "<alt>BackSpace" { "delete-from-cursor" (word-ends, -1) };
|
||||
}
|
||||
|
||||
@binding-set gtk-mac-cmd-c
|
||||
{
|
||||
bind "<meta>x" { "cut-clipboard" () };
|
||||
bind "<meta>c" { "copy-clipboard" () };
|
||||
bind "<meta>v" { "paste-clipboard" () };
|
||||
unbind "<ctrl>x";
|
||||
unbind "<ctrl>c";
|
||||
unbind "<ctrl>v";
|
||||
}
|
||||
|
||||
@binding-set gtk-mac-text-view
|
||||
{
|
||||
bind "<shift><meta>a" { "select-all" (0) };
|
||||
bind "<meta>a" { "select-all" (1) };
|
||||
unbind "<shift><ctrl>a";
|
||||
unbind "<ctrl>a";
|
||||
}
|
||||
|
||||
@binding-set gtk-mac-label
|
||||
{
|
||||
bind "<meta>a" {
|
||||
"move-cursor" (paragraph-ends, -1, 0)
|
||||
"move-cursor" (paragraph-ends, 1, 1)
|
||||
};
|
||||
bind "<shift><meta>a" { "move-cursor" (paragraph-ends, 0, 0) };
|
||||
bind "<meta>c" { "copy-clipboard" () };
|
||||
unbind "<ctrl>a";
|
||||
unbind "<shift><ctrl>a";
|
||||
unbind "<ctrl>c";
|
||||
}
|
||||
|
||||
@binding-set gtk-mac-entry
|
||||
{
|
||||
bind "<meta>a" {
|
||||
"move-cursor" (buffer-ends, -1, 0)
|
||||
"move-cursor" (buffer-ends, 1, 1)
|
||||
};
|
||||
bind "<shift><meta>a" { "move-cursor" (visual-positions, 0, 0) };
|
||||
unbind "<ctrl>a";
|
||||
unbind "<shift><ctrl>a";
|
||||
bind "<ctrl>b" { "move-cursor" (logical-positions, -1, 0) };
|
||||
bind "<shift><ctrl>b" { "move-cursor" (logical-positions, -1, 1) };
|
||||
bind "<ctrl>f" { "move-cursor" (logical-positions, 1, 0) };
|
||||
bind "<shift><ctrl>f" { "move-cursor" (logical-positions, 1, 1) };
|
||||
}
|
||||
|
||||
@binding-set gtk-mac-file-chooser
|
||||
@@ -185,15 +119,15 @@ iconview {
|
||||
}
|
||||
|
||||
textview {
|
||||
-gtk-key-bindings: gtk-mac-alt-arrows, gtk-mac-alt-delete, gtk-mac-cmd-c, gtk-mac-text-view;
|
||||
-gtk-key-bindings: gtk-mac-alt-arrows, gtk-mac-alt-delete, gtk-mac-cmd-c, gtk-mac-cmd-arrows, gtk-mac-emacs-like, gtk-mac-text-view;
|
||||
}
|
||||
|
||||
entry {
|
||||
-gtk-key-bindings: gtk-mac-alt-arrows, gtk-mac-alt-delete, gtk-mac-cmd-c, gtk-mac-entry;
|
||||
-gtk-key-bindings: gtk-mac-alt-arrows, gtk-mac-alt-delete, gtk-mac-cmd-c, gtk-mac-cmd-arrows, gtk-mac-emacs-like, gtk-mac-entry;
|
||||
}
|
||||
|
||||
label {
|
||||
-gtk-key-bindings: gtk-mac-alt-arrows, gtk-mac-label;
|
||||
-gtk-key-bindings: gtk-mac-alt-arrows, gtk-mac-cmd-arrows, gtk-mac-emacs-like, gtk-mac-label;
|
||||
}
|
||||
|
||||
GtkFileChooserWidget {
|
||||
|
||||
@@ -125,8 +125,14 @@ static const LicenseInfo gtk_license_info [] = {
|
||||
{ N_("GNU Lesser General Public License, version 2.1 only"), "https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" },
|
||||
{ N_("GNU Lesser General Public License, version 3 only"), "https://www.gnu.org/licenses/lgpl-3.0.html" },
|
||||
{ N_("GNU Affero General Public License, version 3 or later"), "https://www.gnu.org/licenses/agpl-3.0.html" },
|
||||
{ N_("GNU Affero General Public License, version 3 only"), "https://www.gnu.org/licenses/agpl-3.0.html" }
|
||||
{ N_("GNU Affero General Public License, version 3 only"), "https://www.gnu.org/licenses/agpl-3.0.html" },
|
||||
{ N_("BSD 3-Clause License"), "https://opensource.org/licenses/BSD-3-Clause" },
|
||||
{ N_("Apache License, Version 2.0"), "https://opensource.org/licenses/Apache-2.0" },
|
||||
{ N_("Mozilla Public License 2.0"), "https://opensource.org/licenses/MPL-2.0" }
|
||||
};
|
||||
/* Keep this static assertion updated with the last element of the
|
||||
* enumeration, and make sure it matches the last element of the array */
|
||||
G_STATIC_ASSERT (G_N_ELEMENTS (gtk_license_info) - 1 == GTK_LICENSE_MPL_2_0);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -2464,7 +2470,7 @@ gtk_about_dialog_set_license_type (GtkAboutDialog *about,
|
||||
|
||||
g_return_if_fail (GTK_IS_ABOUT_DIALOG (about));
|
||||
g_return_if_fail (license_type >= GTK_LICENSE_UNKNOWN &&
|
||||
license_type <= GTK_LICENSE_AGPL_3_0_ONLY);
|
||||
license_type < G_N_ELEMENTS (gtk_license_info));
|
||||
|
||||
priv = about->priv;
|
||||
|
||||
|
||||
@@ -60,6 +60,9 @@ typedef struct _GtkAboutDialogPrivate GtkAboutDialogPrivate;
|
||||
* @GTK_LICENSE_LGPL_3_0_ONLY: The GNU Lesser General Public License, version 3.0 only. Since 3.12.
|
||||
* @GTK_LICENSE_AGPL_3_0: The GNU Affero General Public License, version 3.0 or later. Since: 3.22.
|
||||
* @GTK_LICENSE_AGPL_3_0_ONLY: The GNU Affero General Public License, version 3.0 only. Since: 3.22.27.
|
||||
* @GTK_LICENSE_BSD_3: The 3-clause BSD licence. Since: 3.24.20.
|
||||
* @GTK_LICENSE_APACHE_2_0: The Apache License, version 2.0. Since: 3.24.20.
|
||||
* @GTK_LICENSE_MPL_2_0: The Mozilla Public License, version 2.0. Since: 3.24.20.
|
||||
*
|
||||
* The type of license for an application.
|
||||
*
|
||||
@@ -88,7 +91,11 @@ typedef enum {
|
||||
GTK_LICENSE_LGPL_3_0_ONLY,
|
||||
|
||||
GTK_LICENSE_AGPL_3_0,
|
||||
GTK_LICENSE_AGPL_3_0_ONLY
|
||||
GTK_LICENSE_AGPL_3_0_ONLY,
|
||||
|
||||
GTK_LICENSE_BSD_3,
|
||||
GTK_LICENSE_APACHE_2_0,
|
||||
GTK_LICENSE_MPL_2_0
|
||||
} GtkLicense;
|
||||
|
||||
/**
|
||||
|
||||
@@ -199,16 +199,18 @@ set_dialog_properties (GtkAppChooserDialog *self)
|
||||
unknown = g_content_type_is_unknown (self->priv->content_type);
|
||||
}
|
||||
|
||||
title = g_strdup (_("Select Application"));
|
||||
subtitle = NULL;
|
||||
string = NULL;
|
||||
|
||||
if (name != NULL)
|
||||
{
|
||||
title = g_strdup (_("Select Application"));
|
||||
/* Translators: %s is a filename */
|
||||
subtitle = g_strdup_printf (_("Opening “%s”."), name);
|
||||
string = g_strdup_printf (_("No applications found for “%s”"), name);
|
||||
}
|
||||
else
|
||||
else if (self->priv->content_type)
|
||||
{
|
||||
title = g_strdup (_("Select Application"));
|
||||
/* Translators: %s is a file type description */
|
||||
subtitle = g_strdup_printf (_("Opening “%s” files."),
|
||||
unknown ? self->priv->content_type : description);
|
||||
|
||||
@@ -329,8 +329,31 @@ gtk_application_impl_dbus_startup (GtkApplicationImpl *impl,
|
||||
|
||||
if (dbus->ss_proxy)
|
||||
{
|
||||
GVariant *active_var;
|
||||
gboolean active;
|
||||
|
||||
g_signal_connect (dbus->ss_proxy, "g-signal",
|
||||
G_CALLBACK (screensaver_signal_session), impl->application);
|
||||
|
||||
active_var = g_dbus_proxy_call_sync (dbus->ss_proxy,
|
||||
"GetActive",
|
||||
NULL,
|
||||
G_DBUS_CALL_FLAGS_NONE,
|
||||
G_MAXINT,
|
||||
NULL,
|
||||
&error);
|
||||
if (!active_var)
|
||||
{
|
||||
g_debug ("Error calling GetActive on GNOME screensaver: %s",
|
||||
error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_variant_get (active_var, "(b)", &active);
|
||||
g_variant_unref (active_var);
|
||||
gtk_application_set_screensaver_active (dbus->impl.application, active);
|
||||
}
|
||||
}
|
||||
|
||||
g_debug ("Registering client '%s' '%s'", dbus->application_id, client_id);
|
||||
|
||||
@@ -56,14 +56,18 @@ typedef struct
|
||||
} GtkApplicationImplQuartz;
|
||||
|
||||
G_DEFINE_TYPE (GtkApplicationImplQuartz, gtk_application_impl_quartz, GTK_TYPE_APPLICATION_IMPL)
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
@interface GtkApplicationQuartzDelegate : NSObject <NSApplicationDelegate>
|
||||
#else
|
||||
@interface GtkApplicationQuartzDelegate : NSObject
|
||||
#endif
|
||||
{
|
||||
GtkApplicationImplQuartz *quartz;
|
||||
}
|
||||
|
||||
- (id)initWithImpl:(GtkApplicationImplQuartz*)impl;
|
||||
- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender;
|
||||
- (void)application:(NSApplication *)theApplication openFiles:(NSArray *)filenames;
|
||||
@end
|
||||
|
||||
@implementation GtkApplicationQuartzDelegate
|
||||
@@ -84,6 +88,35 @@ G_DEFINE_TYPE (GtkApplicationImplQuartz, gtk_application_impl_quartz, GTK_TYPE_A
|
||||
*/
|
||||
return quartz->quit_inhibit == 0 ? NSTerminateNow : NSTerminateCancel;
|
||||
}
|
||||
|
||||
-(void)application:(NSApplication *)theApplication openFiles:(NSArray *)filenames
|
||||
{
|
||||
GFile **files;
|
||||
gint i;
|
||||
GApplicationFlags flags;
|
||||
|
||||
flags = g_application_get_flags (G_APPLICATION (quartz->impl.application));
|
||||
|
||||
if (~flags & G_APPLICATION_HANDLES_OPEN)
|
||||
{
|
||||
[theApplication replyToOpenOrPrint:NSApplicationDelegateReplyFailure];
|
||||
return;
|
||||
}
|
||||
|
||||
files = g_new (GFile *, [filenames count]);
|
||||
|
||||
for (i = 0; i < [filenames count]; i++)
|
||||
files[i] = g_file_new_for_path ([(NSString *)[filenames objectAtIndex:i] UTF8String]);
|
||||
|
||||
g_application_open (G_APPLICATION (quartz->impl.application), files, [filenames count], "");
|
||||
|
||||
for (i = 0; i < [filenames count]; i++)
|
||||
g_object_unref (files[i]);
|
||||
|
||||
g_free (files);
|
||||
|
||||
[theApplication replyToOpenOrPrint:NSApplicationDelegateReplySuccess];
|
||||
}
|
||||
@end
|
||||
|
||||
/* these exist only for accel handling */
|
||||
@@ -132,7 +165,7 @@ gtk_application_impl_quartz_startup (GtkApplicationImpl *impl,
|
||||
if (register_session)
|
||||
{
|
||||
quartz->delegate = [[GtkApplicationQuartzDelegate alloc] initWithImpl:quartz];
|
||||
[NSApp setDelegate: quartz->delegate];
|
||||
[NSApp setDelegate: (id)(quartz->delegate)];
|
||||
}
|
||||
|
||||
quartz->muxer = gtk_action_muxer_new ();
|
||||
@@ -307,6 +340,13 @@ gtk_application_impl_quartz_is_inhibited (GtkApplicationImpl *impl,
|
||||
static void
|
||||
gtk_application_impl_quartz_init (GtkApplicationImplQuartz *quartz)
|
||||
{
|
||||
/* This is required so that Cocoa is not going to parse the
|
||||
command line arguments by itself and generate OpenFile events.
|
||||
We already parse the command line ourselves, so this is needed
|
||||
to prevent opening files twice, etc. */
|
||||
[[NSUserDefaults standardUserDefaults] setObject:@"NO"
|
||||
forKey:@"NSTreatUnknownArgumentsAsOpen"];
|
||||
|
||||
quartz->combined = g_menu_new ();
|
||||
}
|
||||
|
||||
|
||||