Compare commits
548 Commits
ci-rebuild
...
css-variab
Author | SHA1 | Date | |
---|---|---|---|
|
e5d0f32d8c | ||
|
e825fd901f | ||
|
e3543f37d3 | ||
|
e9bf0322ac | ||
|
6d5cb0a083 | ||
|
8b5aab459a | ||
|
8da3cc10fd | ||
|
f48a4e84af | ||
|
09c76208a2 | ||
|
62b1d21556 | ||
|
8fba58eaa9 | ||
|
b4890edd64 | ||
|
93b9388180 | ||
|
76b2609ad5 | ||
|
a37a0711ad | ||
|
23dbb7122c | ||
|
e04ab263f9 | ||
|
5e6e808a55 | ||
|
6eaf6e2f7d | ||
|
e4a4a0f6dd | ||
|
f301ea7936 | ||
|
a3e9ecd199 | ||
|
cda1733fc7 | ||
|
0ee851c8c7 | ||
|
ed3b73871f | ||
|
e570eb4f86 | ||
|
cfaf619620 | ||
|
de5b6764bc | ||
|
bc17dfa83d | ||
|
84a98f74c1 | ||
|
50facedc47 | ||
|
200cacc3ad | ||
|
eed3cab29f | ||
|
76b0687467 | ||
|
5039dc40f8 | ||
|
7c3de4a2da | ||
|
b486e9b760 | ||
|
ce2fd8a0d0 | ||
|
99b1b26fdb | ||
|
b7e4bbaf74 | ||
|
f579b171a9 | ||
|
f9929d15eb | ||
|
c45a6ad52d | ||
|
7233e38aa8 | ||
|
73ba97acd9 | ||
|
7d2ad604d2 | ||
|
45e64b915c | ||
|
ebaef9f18b | ||
|
c73fe8ac4a | ||
|
8ed8f883d1 | ||
|
032a5afc20 | ||
|
0064500146 | ||
|
4582ddcad9 | ||
|
8bb2720494 | ||
|
3b8218a99e | ||
|
9a8fa8dd82 | ||
|
d6892c85dc | ||
|
d3c20c3269 | ||
|
9904259661 | ||
|
a8fcde11de | ||
|
d2d4cd64cd | ||
|
2c7e68d98f | ||
|
6f42f8ef2c | ||
|
152dd70cde | ||
|
8ec1045c87 | ||
|
46866b8a66 | ||
|
9df6f802f2 | ||
|
ad8613876c | ||
|
1bbca0cd25 | ||
|
83784c17a3 | ||
|
3f46d0f2fa | ||
|
ef1ff8313f | ||
|
119a07e055 | ||
|
abfd94d2d9 | ||
|
6022fbcdf8 | ||
|
744016e768 | ||
|
d39f50a4ee | ||
|
c23d3c4406 | ||
|
1e2eae4ddf | ||
|
77eb3df7c0 | ||
|
e540022869 | ||
|
e6700405c9 | ||
|
5bbd8e12fa | ||
|
8b59771cd1 | ||
|
8a0a08e4ce | ||
|
bef6352401 | ||
|
60a43ddce0 | ||
|
90c9e88ee9 | ||
|
d860bf95ab | ||
|
a3bd0a3e17 | ||
|
d274c7df06 | ||
|
9a5f482e1a | ||
|
2f6140c066 | ||
|
9ce4471527 | ||
|
cda4ec48b2 | ||
|
d9582c123e | ||
|
4d30aacb0c | ||
|
4862c3f779 | ||
|
08d1353cde | ||
|
585dadf575 | ||
|
d069eb173a | ||
|
6015560b63 | ||
|
5a776389d7 | ||
|
6c2dfed5a5 | ||
|
7dec24c2cc | ||
|
c20e7a0c5d | ||
|
719021e1f4 | ||
|
4856e115a9 | ||
|
bfb5bbe862 | ||
|
b98c86fb7b | ||
|
e01c3f581e | ||
|
c45199e388 | ||
|
27fb9917d8 | ||
|
b5d6613a3f | ||
|
5dc77edbe3 | ||
|
a3d63b3579 | ||
|
57c12a8661 | ||
|
f1ccb9b81a | ||
|
2711cb8dcd | ||
|
c79925bd4a | ||
|
05d5860dc0 | ||
|
a1fdf06d80 | ||
|
36d7ca058e | ||
|
2e08db91ca | ||
|
2c9b47ff3c | ||
|
62ad1a61dc | ||
|
3fc9de7539 | ||
|
1c9a55d185 | ||
|
492940205e | ||
|
985e4906c8 | ||
|
e9dcf8167c | ||
|
3aa6c27c26 | ||
|
f537a55b71 | ||
|
7075e6be89 | ||
|
016354b6dd | ||
|
1dfc6d65df | ||
|
b7d0295481 | ||
|
a2854af325 | ||
|
320496b039 | ||
|
b0450d4b1b | ||
|
91ff8bf336 | ||
|
7b145f72dc | ||
|
0dcc21b605 | ||
|
bd43a9e868 | ||
|
9bf23d80a1 | ||
|
38fd66dc04 | ||
|
f004f14b89 | ||
|
8f15f6959c | ||
|
f26efd9adf | ||
|
3f342d75b2 | ||
|
3ab189404e | ||
|
48fc8d6606 | ||
|
2e0f411de9 | ||
|
f08e36e225 | ||
|
9f358ac655 | ||
|
33d1349e53 | ||
|
6b2b6ceb74 | ||
|
76421847a5 | ||
|
840cd6e44c | ||
|
f81038e99a | ||
|
007e7c68dc | ||
|
e5e147ad53 | ||
|
58e00040e0 | ||
|
5d1b8399fb | ||
|
deec2b6c6c | ||
|
246eb8ea25 | ||
|
815df9a76a | ||
|
f896dddadc | ||
|
d733e94a8b | ||
|
59db0ca328 | ||
|
3bd97590a1 | ||
|
722a0fa36d | ||
|
b21708c5e4 | ||
|
b5fb584316 | ||
|
fd1e1b9b7c | ||
|
c0caae0ff0 | ||
|
5c972e4786 | ||
|
1a3c5cf420 | ||
|
eb7affd911 | ||
|
a05dbff2c9 | ||
|
4b0d17b332 | ||
|
2d8f677e63 | ||
|
b5c9b6aa25 | ||
|
86924c2f9a | ||
|
af0f5e3f30 | ||
|
9e6c72210d | ||
|
ce0b2d6953 | ||
|
d1bb3f66ac | ||
|
70cd0e28ab | ||
|
2e00bcc580 | ||
|
db68c1f2c6 | ||
|
e3fa60a070 | ||
|
c9c29d8bde | ||
|
cd59d62947 | ||
|
4f4fe4ef44 | ||
|
06f83847c6 | ||
|
941b5c2aeb | ||
|
d661b7f258 | ||
|
f86d996d58 | ||
|
fe3031fb99 | ||
|
4b001a24db | ||
|
4727fea631 | ||
|
7ff4cba624 | ||
|
0363cc83b9 | ||
|
c1327e2c1b | ||
|
9971707544 | ||
|
02115912aa | ||
|
e29571e6a6 | ||
|
582ad79088 | ||
|
3fac42fd3c | ||
|
8f0b38b462 | ||
|
6c5a106d7e | ||
|
5f7cab4632 | ||
|
558db5a3a7 | ||
|
bc94b4f235 | ||
|
4c809281b2 | ||
|
81faf7caa3 | ||
|
7477e8626d | ||
|
47f30d208c | ||
|
74a1c0916a | ||
|
ee67edbe3a | ||
|
ec9cdb74ef | ||
|
ad0f9144ec | ||
|
3e8215a971 | ||
|
8df7487e2a | ||
|
633692b53e | ||
|
e0a5c65003 | ||
|
e4753791c0 | ||
|
a57f7e3935 | ||
|
8de5a94eb7 | ||
|
88872d1986 | ||
|
ab33b56ec9 | ||
|
c37e88d561 | ||
|
2638700435 | ||
|
0a5a720fe1 | ||
|
0e5f7601e4 | ||
|
e583e823b5 | ||
|
a96358046f | ||
|
40f26ea09b | ||
|
71a7f0771b | ||
|
00739718ab | ||
|
19881c8c06 | ||
|
8b0aae8536 | ||
|
fbe000734a | ||
|
0c67b367ac | ||
|
f75b4aac1d | ||
|
d563d158c0 | ||
|
5c892fa4ea | ||
|
4aac64edf0 | ||
|
c97bbfdfb1 | ||
|
a44598772d | ||
|
933a0e5a98 | ||
|
e33e9c506d | ||
|
0108a5f56d | ||
|
c995473407 | ||
|
3f9bdaa4c8 | ||
|
a70998aa50 | ||
|
0fb1f44eec | ||
|
26cc96bb7f | ||
|
1c8b22cf05 | ||
|
abbbd08931 | ||
|
587cf28dd3 | ||
|
53231a137c | ||
|
104a264d8b | ||
|
75fd582b97 | ||
|
89977412e9 | ||
|
ce030b1b36 | ||
|
6c5dc8cd1f | ||
|
fb4b38e5ea | ||
|
fc405f8882 | ||
|
afe61e28e0 | ||
|
4f3f3c9ae2 | ||
|
e699685003 | ||
|
9583195e96 | ||
|
a526f0770e | ||
|
707e492f0d | ||
|
680dba6524 | ||
|
d1bb1d091c | ||
|
6510b876d1 | ||
|
e376941e49 | ||
|
4889199b14 | ||
|
2e15225446 | ||
|
9dad71513c | ||
|
ed072b4b5d | ||
|
7ffc4e0a21 | ||
|
b9403f4f5b | ||
|
9f1aa3141b | ||
|
06e905f87d | ||
|
2ba8dcebff | ||
|
95a8def7c2 | ||
|
777799070d | ||
|
0f83a9550b | ||
|
17f2443350 | ||
|
6bfc995097 | ||
|
8068111c6e | ||
|
6e1c47b021 | ||
|
aed4ced032 | ||
|
96160ea5dc | ||
|
c76c07ddfe | ||
|
7b82dc7ac5 | ||
|
a63e9d38fb | ||
|
cc8db1805d | ||
|
948532f3c9 | ||
|
8f39f8d827 | ||
|
5e28c05121 | ||
|
32d15a5858 | ||
|
460eaac1f4 | ||
|
02d7817632 | ||
|
3080e2974d | ||
|
be9d98ed38 | ||
|
944274bc58 | ||
|
b555e909c4 | ||
|
c0b813940e | ||
|
9fe9ea34fd | ||
|
d90dc7f75e | ||
|
f36f1b9829 | ||
|
2b09f5ea1e | ||
|
f51c82a2aa | ||
|
11d3be278d | ||
|
cc98282caa | ||
|
85f2e1ccd8 | ||
|
91b98bc9e2 | ||
|
704ee6a9d0 | ||
|
72e9f30937 | ||
|
aadaf4adf2 | ||
|
d83ad6b505 | ||
|
b647d1a58c | ||
|
3c94e91e5e | ||
|
8a1bee1d79 | ||
|
9297439de4 | ||
|
68cff3b108 | ||
|
84846aace7 | ||
|
7bd93730d1 | ||
|
c5d05fdc88 | ||
|
f6ff2cd1cb | ||
|
9b0060e84d | ||
|
8d5633cb88 | ||
|
f74b1d48b6 | ||
|
27ebf756fe | ||
|
631da2e723 | ||
|
b5531d3d6f | ||
|
5e6bc41fdd | ||
|
d0581af2af | ||
|
cec746804d | ||
|
ade1aaa8be | ||
|
345d23898d | ||
|
415717276a | ||
|
cebe640bce | ||
|
73084b761f | ||
|
eb13ecfbe7 | ||
|
85c4507609 | ||
|
fcb6c8e447 | ||
|
0b27f39c2b | ||
|
2101f880af | ||
|
2cc241732d | ||
|
c01782b0a9 | ||
|
a62831562f | ||
|
40dd81e1a4 | ||
|
a9f3a52c18 | ||
|
0978912922 | ||
|
3c9923d395 | ||
|
0296f49eb0 | ||
|
4b7a550366 | ||
|
37e18b784e | ||
|
1275a2cb8d | ||
|
67a6f343a0 | ||
|
a98e6bff85 | ||
|
d0f5644771 | ||
|
b1a3ac8330 | ||
|
80811069ac | ||
|
6e3dc1e669 | ||
|
d1aa0a74e4 | ||
|
7a6fb09179 | ||
|
5732c5e3d0 | ||
|
79fb3d9b0c | ||
|
17455054f1 | ||
|
763f51cb98 | ||
|
9fb78603ec | ||
|
f802be88e9 | ||
|
b9d2049991 | ||
|
cfe3558610 | ||
|
35d15de3b6 | ||
|
23a336df0e | ||
|
bacdc735a4 | ||
|
19a168446e | ||
|
47ec7bc66d | ||
|
b4178870dd | ||
|
03ef792802 | ||
|
7955efef6c | ||
|
3134003376 | ||
|
a508860d1f | ||
|
c835ca41e0 | ||
|
2d5eafd014 | ||
|
9b34878208 | ||
|
4b1b956d27 | ||
|
0dd58c4d1b | ||
|
4b2b6d6212 | ||
|
2cdb53d524 | ||
|
4f7721e742 | ||
|
29c29b0e64 | ||
|
3d7fc0a598 | ||
|
9e3e0052dc | ||
|
5ecfcaec0d | ||
|
cc24401dfb | ||
|
f445d8b518 | ||
|
af4c9ea61e | ||
|
4a75c288b2 | ||
|
89fca57e68 | ||
|
d50b780551 | ||
|
f4a8787219 | ||
|
979d0f4b1d | ||
|
5af7c7d0f2 | ||
|
90aff59826 | ||
|
f0f3ea1b3e | ||
|
f4b7f5de2f | ||
|
ca5af396b0 | ||
|
9f56be3551 | ||
|
389f41ead7 | ||
|
62108f8c30 | ||
|
d3206f9b67 | ||
|
9b81f4cc31 | ||
|
a864084a4e | ||
|
ba44464d2a | ||
|
9509876f10 | ||
|
f79549f5fc | ||
|
bfb451ff4d | ||
|
edfbfb2ba7 | ||
|
6aa37a116d | ||
|
a34c018592 | ||
|
710d8b948b | ||
|
3df85581d5 | ||
|
91e3bc4496 | ||
|
1f5df481a5 | ||
|
768522ce7f | ||
|
5f4e5db91b | ||
|
c5f73cb406 | ||
|
86c4a9b3bd | ||
|
fb915dc8da | ||
|
7a2569be14 | ||
|
b1eed1c153 | ||
|
fac6f6c712 | ||
|
3f1fc798f0 | ||
|
e6a86f61dc | ||
|
2799632c02 | ||
|
8ffa681e02 | ||
|
154035e76f | ||
|
1d4c664bfa | ||
|
85a650afce | ||
|
f6c4d3731c | ||
|
5e9070145e | ||
|
81ced841dd | ||
|
9837a9dcfd | ||
|
1704ec3c7d | ||
|
c70a326055 | ||
|
53616a73e9 | ||
|
2d3a3d6a78 | ||
|
6ca9e5987b | ||
|
2c1590001f | ||
|
82aee038e9 | ||
|
a94d7abf0d | ||
|
3b87903889 | ||
|
191f826075 | ||
|
5d52c43074 | ||
|
f6a67aeb20 | ||
|
370e2f0940 | ||
|
2ec9fc26d3 | ||
|
c2d898d462 | ||
|
7c04231255 | ||
|
08216dcee9 | ||
|
9817df12ff | ||
|
5b0e8eb574 | ||
|
cecde85faa | ||
|
aa95b4f341 | ||
|
816f8807a3 | ||
|
26d3c407b3 | ||
|
a973e8ea8d | ||
|
b007597c58 | ||
|
1e83a44c93 | ||
|
e1406d2e95 | ||
|
259ad83de9 | ||
|
2fe467983c | ||
|
b4f5432d5a | ||
|
4fe4523c49 | ||
|
ee4a56ed4a | ||
|
2408e227aa | ||
|
144cd2d91c | ||
|
6abd9def55 | ||
|
f5685cc0ae | ||
|
54bd03573e | ||
|
bc81b33990 | ||
|
de764d61ef | ||
|
68fa9bcf2e | ||
|
2f124bc712 | ||
|
c648bb7b19 | ||
|
90956b15d9 | ||
|
195ebf6848 | ||
|
0615b48318 | ||
|
aff34e8d1b | ||
|
c05bb504ff | ||
|
47307dc7c1 | ||
|
16ea91c1fe | ||
|
96b800fa0c | ||
|
e7a2baf78c | ||
|
438d86fcf5 | ||
|
4fd848c9de | ||
|
a23a7d4149 | ||
|
1cbdf88b0f | ||
|
0a0feef57d | ||
|
2701a2bfdd | ||
|
2aea75f426 | ||
|
b1fb7cd4ae | ||
|
33ffe28236 | ||
|
fd90b56df6 | ||
|
43373e6350 | ||
|
afd5ea53d8 | ||
|
f725bdad25 | ||
|
cfbe3709bf | ||
|
4e453acd4f | ||
|
3a04542146 | ||
|
d6a1eb1b2f | ||
|
802110bfe5 | ||
|
141769fb46 | ||
|
0fdb6a9243 | ||
|
d007d136c5 | ||
|
cb374efb9a | ||
|
8334d21c87 | ||
|
6e132463f1 | ||
|
3f8f6f6792 | ||
|
93cdcc5e88 | ||
|
d51912c0b4 | ||
|
bad6e1e102 | ||
|
28a8dc5a14 | ||
|
975cdd8c30 | ||
|
153b78e2bc | ||
|
de2b10e46c | ||
|
7cf4414f4a | ||
|
a9dfec8478 | ||
|
60ddf7c421 | ||
|
1922174c9f | ||
|
19a9215e4f | ||
|
85cf995af7 | ||
|
34028ea31e | ||
|
4244314a40 | ||
|
e6046e9493 | ||
|
02cdb36421 | ||
|
b3d4d70bc1 | ||
|
e5ffbb19c0 | ||
|
715c0bfc0a |
@@ -445,9 +445,8 @@ reference:
|
|||||||
--force-fallback-for=gdk-pixbuf,pango
|
--force-fallback-for=gdk-pixbuf,pango
|
||||||
-Dintrospection=enabled
|
-Dintrospection=enabled
|
||||||
-Ddocumentation=true
|
-Ddocumentation=true
|
||||||
-Dgtk_doc=true
|
|
||||||
-Dgdk-pixbuf:gtk_doc=true
|
-Dgdk-pixbuf:gtk_doc=true
|
||||||
-Dpango:gtk_doc=true
|
-Dpango:documentation=true
|
||||||
-Dbuild-demos=false
|
-Dbuild-demos=false
|
||||||
-Dbuild-examples=false
|
-Dbuild-examples=false
|
||||||
-Dbuild-tests=false
|
-Dbuild-tests=false
|
||||||
|
@@ -2,8 +2,6 @@ FROM fedora:39
|
|||||||
|
|
||||||
RUN dnf -y install \
|
RUN dnf -y install \
|
||||||
adwaita-icon-theme \
|
adwaita-icon-theme \
|
||||||
atk-devel \
|
|
||||||
at-spi2-atk-devel \
|
|
||||||
avahi-gobject-devel \
|
avahi-gobject-devel \
|
||||||
cairo-devel \
|
cairo-devel \
|
||||||
cairo-gobject-devel \
|
cairo-gobject-devel \
|
||||||
@@ -18,7 +16,6 @@ RUN dnf -y install \
|
|||||||
dejavu-sans-mono-fonts \
|
dejavu-sans-mono-fonts \
|
||||||
desktop-file-utils \
|
desktop-file-utils \
|
||||||
diffutils \
|
diffutils \
|
||||||
docbook-style-xsl \
|
|
||||||
elfutils-libelf-devel \
|
elfutils-libelf-devel \
|
||||||
expat-devel \
|
expat-devel \
|
||||||
fribidi-devel \
|
fribidi-devel \
|
||||||
|
@@ -19,13 +19,12 @@ flatpak build ${builddir} meson \
|
|||||||
--buildtype=debugoptimized \
|
--buildtype=debugoptimized \
|
||||||
-Dx11-backend=true \
|
-Dx11-backend=true \
|
||||||
-Dwayland-backend=true \
|
-Dwayland-backend=true \
|
||||||
-Dvulkan=disabled \
|
|
||||||
-Dbuild-tests=false \
|
-Dbuild-tests=false \
|
||||||
-Dbuild-testsuite=false \
|
-Dbuild-testsuite=false \
|
||||||
-Dbuild-examples=false \
|
-Dbuild-examples=false \
|
||||||
-Dintrospection=disabled \
|
-Dintrospection=disabled \
|
||||||
-Dbuild-demos=true \
|
-Dbuild-demos=true \
|
||||||
-Ddemo-profile=devel \
|
-Dprofile=devel \
|
||||||
_flatpak_build
|
_flatpak_build
|
||||||
|
|
||||||
flatpak build --env=CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA ${builddir} ninja -C _flatpak_build install
|
flatpak build --env=CI_COMMIT_SHORT_SHA=$CI_COMMIT_SHORT_SHA ${builddir} ninja -C _flatpak_build install
|
||||||
|
@@ -34,7 +34,8 @@ pacman --noconfirm -S --needed \
|
|||||||
mingw-w64-$MSYS2_ARCH-shared-mime-info \
|
mingw-w64-$MSYS2_ARCH-shared-mime-info \
|
||||||
mingw-w64-$MSYS2_ARCH-python-gobject \
|
mingw-w64-$MSYS2_ARCH-python-gobject \
|
||||||
mingw-w64-$MSYS2_ARCH-shaderc \
|
mingw-w64-$MSYS2_ARCH-shaderc \
|
||||||
mingw-w64-$MSYS2_ARCH-vulkan
|
mingw-w64-$MSYS2_ARCH-vulkan \
|
||||||
|
mingw-w64-$MSYS2_ARCH-vulkan-headers
|
||||||
|
|
||||||
mkdir -p _ccache
|
mkdir -p _ccache
|
||||||
export CCACHE_BASEDIR="$(pwd)"
|
export CCACHE_BASEDIR="$(pwd)"
|
||||||
@@ -44,7 +45,7 @@ export CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
|
|||||||
ccache --zero-stats
|
ccache --zero-stats
|
||||||
ccache --show-stats
|
ccache --show-stats
|
||||||
export CCACHE_DISABLE=true
|
export CCACHE_DISABLE=true
|
||||||
meson \
|
meson setup \
|
||||||
-Dx11-backend=false \
|
-Dx11-backend=false \
|
||||||
-Dwayland-backend=false \
|
-Dwayland-backend=false \
|
||||||
-Dwin32-backend=true \
|
-Dwin32-backend=true \
|
||||||
|
@@ -35,7 +35,7 @@ The issue tracker is meant to be used for actionable issues only.
|
|||||||
|
|
||||||
You should not open a new issue for security related questions.
|
You should not open a new issue for security related questions.
|
||||||
|
|
||||||
When in doubt, follow [security](https://security.gnome.org/).
|
When in doubt, follow the process for [GNOME security issues](https://security.gnome.org/).
|
||||||
|
|
||||||
### Bug reports
|
### Bug reports
|
||||||
|
|
||||||
@@ -144,33 +144,28 @@ $ git clone https://gitlab.gnome.org/yourusername/gtk.git
|
|||||||
$ cd gtk
|
$ cd gtk
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note**: if you plan to push changes to back to the main repository and
|
|
||||||
have a GNOME account, you can skip the fork, and use the following instead:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ git clone git@gitlab.gnome.org:GNOME/gtk.git
|
|
||||||
$ cd gtk
|
|
||||||
```
|
|
||||||
|
|
||||||
To compile the Git version of GTK on your system, you will need to
|
To compile the Git version of GTK on your system, you will need to
|
||||||
configure your build using Meson:
|
configure your build using Meson:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ meson _builddir .
|
$ meson setup _builddir .
|
||||||
$ cd _builddir
|
$ meson compile -C _builddir
|
||||||
$ ninja
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Typically, you should work on your own branch:
|
Typically, you should work on your own branch:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ git checkout -b your-branch
|
$ git switch -C your-branch
|
||||||
```
|
```
|
||||||
|
|
||||||
Once you've finished working on the bug fix or feature, push the branch
|
Once you've finished working on the bug fix or feature, push the branch
|
||||||
to the Git repository and open a new merge request, to let the GTK
|
to the Git repository and open a new merge request, to let the GTK
|
||||||
maintainers review your contribution.
|
maintainers review your contribution.
|
||||||
|
|
||||||
|
**Important**: Do **not** attach a diff or a patch file to a GitLab issue.
|
||||||
|
Patches cannot be reviewed, and do not not go through the CI pipeline. If
|
||||||
|
you wish to submit your changes to GTK, always use a merge request.
|
||||||
|
|
||||||
### Code reviews
|
### Code reviews
|
||||||
|
|
||||||
Each contribution is reviewed by the core developers of the GTK project.
|
Each contribution is reviewed by the core developers of the GTK project.
|
||||||
@@ -262,4 +257,4 @@ people committing to GTK to follow a few rules:
|
|||||||
|
|
||||||
If you have been contributing to GTK for a while and you don't have commit
|
If you have been contributing to GTK for a while and you don't have commit
|
||||||
access to the repository, you may ask to obtain it following the [GNOME account
|
access to the repository, you may ask to obtain it following the [GNOME account
|
||||||
process](https://wiki.gnome.org/AccountsTeam/NewAccounts).
|
process](https://handbook.gnome.org/infrastructure/developer-access.html).
|
||||||
|
246
NEWS
@@ -1,6 +1,250 @@
|
|||||||
Overview of Changes in 4.14.1, xx-xx-xxxx
|
Overview of Changes in 4.15.1, xx-xx-xxxx
|
||||||
=========================================
|
=========================================
|
||||||
|
|
||||||
|
* GtkGraphicsOffload:
|
||||||
|
- Don't crash without a child
|
||||||
|
|
||||||
|
* CSS:
|
||||||
|
- Support the :root selector
|
||||||
|
|
||||||
|
* Icontheme:
|
||||||
|
- Make symbolic svg loading more efficient
|
||||||
|
- Handle color-free symbolics more efficiently
|
||||||
|
|
||||||
|
* Accessibility:
|
||||||
|
- Make the gtk-demo sidebar search more accessible
|
||||||
|
- Stop emitting focus events
|
||||||
|
|
||||||
|
* GDK:
|
||||||
|
- Support XDG_ACTIVATION_TOKEN
|
||||||
|
- dmabuf: Be more defensive when importing unknown formats to GL
|
||||||
|
- dmabuf: Use narrow range for YUV
|
||||||
|
|
||||||
|
* GSK:
|
||||||
|
- Improve logging for GDK_DEBUG=offload
|
||||||
|
- Improve logging for GSK_DEBUG=renderer
|
||||||
|
- gpu: Warn about inefficient texture import
|
||||||
|
- gpu: Handle tiny offscreens correctly
|
||||||
|
- vulkan: Add profiler marks in various places
|
||||||
|
- vulkan: Fix a problem with imported dmabufs showing up black
|
||||||
|
|
||||||
|
* Wayland:
|
||||||
|
- Use wl_compositor version 6
|
||||||
|
|
||||||
|
* X11:
|
||||||
|
- Implement a missing method
|
||||||
|
|
||||||
|
* Build:
|
||||||
|
- Fix many ubsan warnings
|
||||||
|
|
||||||
|
* Debugging:
|
||||||
|
- Show more texture details in the recorder
|
||||||
|
|
||||||
|
* macOS:
|
||||||
|
- Fix problems with events handed back to the OS
|
||||||
|
- Respect GDK_DEBUG=default-settings
|
||||||
|
|
||||||
|
* Translation updates:
|
||||||
|
Korean
|
||||||
|
Turkish
|
||||||
|
|
||||||
|
|
||||||
|
Overview of Changes in 4.15.0, 21-04-2024
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
This release changes the default GSK renderer to be Vulkan, on
|
||||||
|
Wayland. Other platforms still use ngl.
|
||||||
|
|
||||||
|
The intent of this change is to get wider testing and verify that
|
||||||
|
Vulkan drivers are good enough for us to rely on. If significant
|
||||||
|
problems show up, we will revert this change for 4.16.
|
||||||
|
|
||||||
|
You can still override the renderer choice using the GSK_RENDERER
|
||||||
|
environment variable.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
This release also changes font rendering settings by introducing
|
||||||
|
a new high-level gtk-font-rendering settings which gives GTK more
|
||||||
|
freedom to decide on font rendering.
|
||||||
|
|
||||||
|
You can still use the low-level font-related settings by changing
|
||||||
|
the new property to 'manual'.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
* GtkColumnView:
|
||||||
|
- Fix infinite loops in dispose
|
||||||
|
- Fix problems with weak ref cycles in GtkExpression
|
||||||
|
|
||||||
|
* GtkListView:
|
||||||
|
* GtkShortcutManager:
|
||||||
|
- Track the propagation phase of added controllers
|
||||||
|
|
||||||
|
* GtkGLArea:
|
||||||
|
- Produce dmabuf textures, so graphics offload is possible
|
||||||
|
|
||||||
|
* GtkTextView:
|
||||||
|
- Support text shadows
|
||||||
|
|
||||||
|
* GtkGraphicsOffload:
|
||||||
|
- Add a black-background property
|
||||||
|
|
||||||
|
* Settings:
|
||||||
|
- Add a new gtk-font-rendering setting
|
||||||
|
|
||||||
|
* Accessibility:
|
||||||
|
- Add support for GetRangeExtents to GtkAccessibleText
|
||||||
|
- Add support for GetOffsetAtPoint to GtkAccessibleText
|
||||||
|
- Implement GtkAccessibleRange for scrollbars
|
||||||
|
|
||||||
|
* GDK:
|
||||||
|
- Add a callback-based cursor API
|
||||||
|
|
||||||
|
* GSK:
|
||||||
|
- Use the Vulkan renderer by default
|
||||||
|
- Avoid an infinite recursion with offscreens in some cases
|
||||||
|
- Optimize graphics offload to make it more likely that compositors
|
||||||
|
can use direct scanout
|
||||||
|
|
||||||
|
* X11:
|
||||||
|
- Fix some confusing debug messages
|
||||||
|
- Drop a no-longer-relevant optimization that was interfering with
|
||||||
|
getting the current window manager capabilities
|
||||||
|
|
||||||
|
* macOS:
|
||||||
|
- Implement the color picker for macOS 10.15+
|
||||||
|
|
||||||
|
* Debugging:
|
||||||
|
- Snow monitor resolution in the inspector
|
||||||
|
|
||||||
|
* Demos:
|
||||||
|
- Use graphics offload in the shadertoy demo
|
||||||
|
- Show more reliable fps numbers in the fishbowl demo
|
||||||
|
|
||||||
|
* Tools:
|
||||||
|
- Support generating pdf in gtk4-rendernode-tool
|
||||||
|
|
||||||
|
* Build:
|
||||||
|
- Require pango 1.52
|
||||||
|
- Require cairo 1.18
|
||||||
|
- Add a missing dependency that was causing build failures
|
||||||
|
- Drop deprecated build options:
|
||||||
|
gtk_doc -> documentation
|
||||||
|
update_screenshots -> screenshots
|
||||||
|
demo-profile -> profile
|
||||||
|
demos -> build-demos
|
||||||
|
|
||||||
|
* Deprecations:
|
||||||
|
- gdk_widget_set/get_font_options
|
||||||
|
- gdk_wayland/x11_display_set_cursor_theme
|
||||||
|
|
||||||
|
* Translation updates:
|
||||||
|
Basque
|
||||||
|
Brazilian Portuguese
|
||||||
|
British English
|
||||||
|
Chinese (China)
|
||||||
|
Hebrew
|
||||||
|
Kabyle
|
||||||
|
Persian
|
||||||
|
Polish
|
||||||
|
Russian
|
||||||
|
Slovenian
|
||||||
|
Swedish
|
||||||
|
Turkish
|
||||||
|
|
||||||
|
|
||||||
|
Overview of Changes in 4.14.2, 03-04-2024
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
* GtkScale:
|
||||||
|
- Improve positioning of values in some cases
|
||||||
|
|
||||||
|
* Theme:
|
||||||
|
- Make progress in entries visible
|
||||||
|
|
||||||
|
* Accessibility:
|
||||||
|
- Fix text insertion handling
|
||||||
|
|
||||||
|
* GDK:
|
||||||
|
- dnd: Use the default cursor durion motion
|
||||||
|
- dnd: Use a better cursor for indicating the move action
|
||||||
|
|
||||||
|
* GSK:
|
||||||
|
- gl: Handle offloads in offscreen context better
|
||||||
|
- Fix text rendering problems with some fonts
|
||||||
|
|
||||||
|
* Wayland:
|
||||||
|
- Tighten up some protocol version checks
|
||||||
|
- Use the presentation time protocol
|
||||||
|
- Fix a crash with subsurfaces
|
||||||
|
- Improve settings portal handling
|
||||||
|
|
||||||
|
* macOS:
|
||||||
|
- Fix up the app menu support
|
||||||
|
|
||||||
|
* Windows:
|
||||||
|
- Fix problems with minimization
|
||||||
|
- Fix build without fontconfig
|
||||||
|
|
||||||
|
* Debugging:
|
||||||
|
- Add font settings in the inspector
|
||||||
|
|
||||||
|
* Demos:
|
||||||
|
- Clean up the application demo
|
||||||
|
- Update cursor images for the cursor demo
|
||||||
|
|
||||||
|
* Translation updates:
|
||||||
|
Catalan
|
||||||
|
Czech
|
||||||
|
French
|
||||||
|
Georgian
|
||||||
|
Hebrew
|
||||||
|
Persian
|
||||||
|
Slovenian
|
||||||
|
Turkish
|
||||||
|
Ukrainian
|
||||||
|
|
||||||
|
|
||||||
|
Overview of Changes in 4.14.1, 16-03-2024
|
||||||
|
=========================================
|
||||||
|
|
||||||
|
* GtkTextView:
|
||||||
|
- Fix a mixup of cursor and anchor when retrieving surrounding text
|
||||||
|
in input methods
|
||||||
|
|
||||||
|
* Printing:
|
||||||
|
- Avoid accessing freed printers
|
||||||
|
|
||||||
|
* Accessibility:
|
||||||
|
- Fix memory leaks
|
||||||
|
|
||||||
|
* GDK:
|
||||||
|
- Rename the GDK_VULKAN_SKIP environment variable to GDK_VULKAN_DISABLE
|
||||||
|
- Add a GDK_GL_DISABLE environment variable
|
||||||
|
|
||||||
|
* GSK:
|
||||||
|
- Rename the GSK_GPU_SKIP environment variable to GSK_GPU_DISABLE
|
||||||
|
- Speed up handling of repeated ops, which should help for text
|
||||||
|
- Speed up the inner loop of text node conversion
|
||||||
|
- Drop the glyph-align optimization flag
|
||||||
|
- ngl: Avoid reusing frames while they are in use
|
||||||
|
- Fix flickering thumbnails in nautilus
|
||||||
|
- Speed up buffer handling in both ngl and Vulkan
|
||||||
|
|
||||||
|
* Demos:
|
||||||
|
- Skip demos using gl shaders when we're not using the gl renderer
|
||||||
|
|
||||||
|
* Build:
|
||||||
|
- Fix some ubsan warnings
|
||||||
|
- Avoid zink in ci since it spams stderr
|
||||||
|
|
||||||
|
* Translation updates:
|
||||||
|
Czech
|
||||||
|
German
|
||||||
|
Korean
|
||||||
|
Russian
|
||||||
|
|
||||||
|
|
||||||
Overview of Changes in 4.14.0, 12-03-2024
|
Overview of Changes in 4.14.0, 12-03-2024
|
||||||
=========================================
|
=========================================
|
||||||
|
@@ -125,7 +125,7 @@ version, for example `gtk-4-10`.
|
|||||||
How to report bugs
|
How to report bugs
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
Bugs should be reported on the [issues page](https://gitlab.gnome.org/GNOME/gtk/issues/new).
|
Bugs should be reported on the [issues page](https://gitlab.gnome.org/GNOME/gtk/issues/).
|
||||||
|
|
||||||
In the bug report please include:
|
In the bug report please include:
|
||||||
|
|
||||||
|
@@ -185,9 +185,8 @@
|
|||||||
"builddir" : true,
|
"builddir" : true,
|
||||||
"config-opts" : [
|
"config-opts" : [
|
||||||
"--libdir=/app/lib",
|
"--libdir=/app/lib",
|
||||||
"-Dvulkan=disabled",
|
|
||||||
"-Dbuildtype=debugoptimized",
|
"-Dbuildtype=debugoptimized",
|
||||||
"-Ddemo-profile=devel"
|
"-Dprofile=devel"
|
||||||
],
|
],
|
||||||
"sources" : [
|
"sources" : [
|
||||||
{
|
{
|
||||||
|
@@ -114,9 +114,8 @@
|
|||||||
"builddir" : true,
|
"builddir" : true,
|
||||||
"config-opts" : [
|
"config-opts" : [
|
||||||
"--libdir=/app/lib",
|
"--libdir=/app/lib",
|
||||||
"-Dvulkan=disabled",
|
|
||||||
"-Dbuildtype=debugoptimized",
|
"-Dbuildtype=debugoptimized",
|
||||||
"-Ddemo-profile=devel"
|
"-Dprofile=devel"
|
||||||
],
|
],
|
||||||
"sources" : [
|
"sources" : [
|
||||||
{
|
{
|
||||||
|
@@ -114,9 +114,8 @@
|
|||||||
"builddir" : true,
|
"builddir" : true,
|
||||||
"config-opts" : [
|
"config-opts" : [
|
||||||
"--libdir=/app/lib",
|
"--libdir=/app/lib",
|
||||||
"-Dvulkan=disabled",
|
|
||||||
"-Dbuildtype=debugoptimized",
|
"-Dbuildtype=debugoptimized",
|
||||||
"-Ddemo-profile=devel"
|
"-Dprofile=devel"
|
||||||
],
|
],
|
||||||
"sources" : [
|
"sources" : [
|
||||||
{
|
{
|
||||||
@@ -131,7 +130,6 @@
|
|||||||
"env" : {
|
"env" : {
|
||||||
"DBUS_SESSION_BUS_ADDRESS" : "''",
|
"DBUS_SESSION_BUS_ADDRESS" : "''",
|
||||||
"GSK_RENDERER" : "opengl",
|
"GSK_RENDERER" : "opengl",
|
||||||
"GDK_DEBUG" : "vulkan-disable",
|
|
||||||
"G_ENABLE_DEBUG" : "true"
|
"G_ENABLE_DEBUG" : "true"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -114,9 +114,8 @@
|
|||||||
"builddir" : true,
|
"builddir" : true,
|
||||||
"config-opts" : [
|
"config-opts" : [
|
||||||
"--libdir=/app/lib",
|
"--libdir=/app/lib",
|
||||||
"-Dvulkan=disabled",
|
|
||||||
"-Dbuildtype=debugoptimized",
|
"-Dbuildtype=debugoptimized",
|
||||||
"-Ddemo-profile=devel"
|
"-Dprofile=devel"
|
||||||
],
|
],
|
||||||
"sources" : [
|
"sources" : [
|
||||||
{
|
{
|
||||||
@@ -131,7 +130,6 @@
|
|||||||
"env" : {
|
"env" : {
|
||||||
"DBUS_SESSION_BUS_ADDRESS" : "''",
|
"DBUS_SESSION_BUS_ADDRESS" : "''",
|
||||||
"GSK_RENDERER" : "opengl",
|
"GSK_RENDERER" : "opengl",
|
||||||
"GDK_DEBUG" : "vulkan-disable",
|
|
||||||
"G_ENABLE_DEBUG" : "true"
|
"G_ENABLE_DEBUG" : "true"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@@ -15,12 +15,54 @@ on_destroy (gpointer data)
|
|||||||
window = NULL;
|
window = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GdkTexture *
|
||||||
|
cursor_callback (GdkCursor *cursor,
|
||||||
|
int cursor_size,
|
||||||
|
double scale,
|
||||||
|
int *width,
|
||||||
|
int *height,
|
||||||
|
int *hotspot_x,
|
||||||
|
int *hotspot_y,
|
||||||
|
gpointer data)
|
||||||
|
{
|
||||||
|
GdkPixbuf *pixbuf;
|
||||||
|
GdkTexture *texture;
|
||||||
|
GError *error = NULL;
|
||||||
|
int scaled_size;
|
||||||
|
|
||||||
|
scaled_size = ceil (cursor_size * scale);
|
||||||
|
|
||||||
|
pixbuf = gdk_pixbuf_new_from_resource_at_scale ("/cursors/images/gtk-logo.svg",
|
||||||
|
scaled_size, scaled_size,
|
||||||
|
TRUE,
|
||||||
|
&error);
|
||||||
|
if (!pixbuf)
|
||||||
|
{
|
||||||
|
g_print ("%s\n", error->message);
|
||||||
|
g_error_free (error);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
texture = gdk_texture_new_for_pixbuf (pixbuf);
|
||||||
|
|
||||||
|
g_object_unref (pixbuf);
|
||||||
|
|
||||||
|
*width = cursor_size;
|
||||||
|
*height = cursor_size;
|
||||||
|
*hotspot_x = 18 * cursor_size / 32.0;
|
||||||
|
*hotspot_y = 2 * cursor_size / 32.0;
|
||||||
|
|
||||||
|
return texture;
|
||||||
|
}
|
||||||
|
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
do_cursors (GtkWidget *do_widget)
|
do_cursors (GtkWidget *do_widget)
|
||||||
{
|
{
|
||||||
if (!window)
|
if (!window)
|
||||||
{
|
{
|
||||||
GtkBuilder *builder;
|
GtkBuilder *builder;
|
||||||
|
GtkWidget *logo_callback;
|
||||||
|
GdkCursor *cursor;
|
||||||
|
|
||||||
builder = gtk_builder_new_from_resource ("/cursors/cursors.ui");
|
builder = gtk_builder_new_from_resource ("/cursors/cursors.ui");
|
||||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
|
||||||
@@ -29,6 +71,10 @@ do_cursors (GtkWidget *do_widget)
|
|||||||
gtk_widget_get_display (do_widget));
|
gtk_widget_get_display (do_widget));
|
||||||
g_signal_connect (window, "destroy",
|
g_signal_connect (window, "destroy",
|
||||||
G_CALLBACK (on_destroy), NULL);
|
G_CALLBACK (on_destroy), NULL);
|
||||||
|
logo_callback = GTK_WIDGET (gtk_builder_get_object (builder, "logo_callback"));
|
||||||
|
cursor = gdk_cursor_new_from_callback (cursor_callback, NULL, NULL, NULL);
|
||||||
|
gtk_widget_set_cursor (logo_callback, cursor);
|
||||||
|
g_object_unref (cursor);
|
||||||
g_object_unref (builder);
|
g_object_unref (builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -116,6 +116,7 @@
|
|||||||
<file>w_resize_cursor.png</file>
|
<file>w_resize_cursor.png</file>
|
||||||
<file>zoom_in_cursor.png</file>
|
<file>zoom_in_cursor.png</file>
|
||||||
<file>zoom_out_cursor.png</file>
|
<file>zoom_out_cursor.png</file>
|
||||||
|
<file>gtk-logo.svg</file>
|
||||||
</gresource>
|
</gresource>
|
||||||
<gresource prefix="/dnd">
|
<gresource prefix="/dnd">
|
||||||
<file>dnd.css</file>
|
<file>dnd.css</file>
|
||||||
|
@@ -363,7 +363,9 @@ insert_markup_idle (gpointer data)
|
|||||||
|
|
||||||
if (g_get_monotonic_time () - begin > G_TIME_SPAN_MILLISECOND)
|
if (g_get_monotonic_time () - begin > G_TIME_SPAN_MILLISECOND)
|
||||||
{
|
{
|
||||||
g_idle_add (insert_markup_idle, data);
|
guint id;
|
||||||
|
id = g_idle_add (insert_markup_idle, data);
|
||||||
|
g_source_set_name_by_id (id, "[gtk-demo] insert_markup_idle");
|
||||||
return G_SOURCE_REMOVE;
|
return G_SOURCE_REMOVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -398,7 +400,9 @@ parse_markup_idle (gpointer data)
|
|||||||
do {
|
do {
|
||||||
if (g_get_monotonic_time () - begin > G_TIME_SPAN_MILLISECOND)
|
if (g_get_monotonic_time () - begin > G_TIME_SPAN_MILLISECOND)
|
||||||
{
|
{
|
||||||
g_idle_add (parse_markup_idle, data);
|
guint id;
|
||||||
|
id = g_idle_add (parse_markup_idle, data);
|
||||||
|
g_source_set_name_by_id (id, "[gtk-demo] parse_markup_idle");
|
||||||
return G_SOURCE_REMOVE;
|
return G_SOURCE_REMOVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
138
demos/gtk-demo/gtk-logo.svg
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
<?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#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="128"
|
||||||
|
height="128"
|
||||||
|
id="svg6843"
|
||||||
|
sodipodi:version="0.32"
|
||||||
|
inkscape:version="0.92.4 5da689c313, 2019-01-14"
|
||||||
|
version="1.0"
|
||||||
|
sodipodi:docname="gtk-logo.svg"
|
||||||
|
inkscape:output_extension="org.inkscape.output.svg.inkscape"
|
||||||
|
inkscape:export-filename="/home/ebassi/Pictures/gtk-logo-256.png"
|
||||||
|
inkscape:export-xdpi="192"
|
||||||
|
inkscape:export-ydpi="192">
|
||||||
|
<defs
|
||||||
|
id="defs6845">
|
||||||
|
<inkscape:perspective
|
||||||
|
sodipodi:type="inkscape:persp3d"
|
||||||
|
inkscape:vp_x="-50 : 600 : 1"
|
||||||
|
inkscape:vp_y="0 : 1000 : 0"
|
||||||
|
inkscape:vp_z="700 : 600 : 1"
|
||||||
|
inkscape:persp3d-origin="300 : 400 : 1"
|
||||||
|
id="perspective13" />
|
||||||
|
</defs>
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="2.8284271"
|
||||||
|
inkscape:cx="69.874353"
|
||||||
|
inkscape:cy="64.313526"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:grid-bbox="true"
|
||||||
|
width="128px"
|
||||||
|
height="128px"
|
||||||
|
showguides="true"
|
||||||
|
inkscape:guide-bbox="true"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="1016"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="27"
|
||||||
|
inkscape:window-maximized="1">
|
||||||
|
<inkscape:grid
|
||||||
|
type="xygrid"
|
||||||
|
id="grid7947" />
|
||||||
|
</sodipodi:namedview>
|
||||||
|
<metadata
|
||||||
|
id="metadata6848">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title />
|
||||||
|
<dc:date />
|
||||||
|
<dc:creator>
|
||||||
|
<cc:Agent>
|
||||||
|
<dc:title />
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:creator>
|
||||||
|
<dc:rights>
|
||||||
|
<cc:Agent>
|
||||||
|
<dc:title />
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:rights>
|
||||||
|
<dc:publisher>
|
||||||
|
<cc:Agent>
|
||||||
|
<dc:title />
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:publisher>
|
||||||
|
<dc:identifier />
|
||||||
|
<dc:source />
|
||||||
|
<dc:relation />
|
||||||
|
<dc:language />
|
||||||
|
<dc:subject>
|
||||||
|
<rdf:Bag />
|
||||||
|
</dc:subject>
|
||||||
|
<dc:coverage />
|
||||||
|
<dc:description />
|
||||||
|
<dc:contributor>
|
||||||
|
<cc:Agent>
|
||||||
|
<dc:title />
|
||||||
|
</cc:Agent>
|
||||||
|
</dc:contributor>
|
||||||
|
<cc:license
|
||||||
|
rdf:resource="" />
|
||||||
|
</cc:Work>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
id="layer1"
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer">
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="ccccc"
|
||||||
|
id="path6976"
|
||||||
|
d="M 20.88413,30.82696 L 53.816977,55.527708 L 107.33282,39.060543 L 70.587303,17.177763 L 20.88413,30.82696 z"
|
||||||
|
style="fill:#729fcf;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
|
||||||
|
<path
|
||||||
|
id="path6978"
|
||||||
|
d="M 22.94243,82.287118 L 20.88413,30.82696 L 53.816977,55.527708 L 53.816977,111.10486 L 22.94243,82.287118 z"
|
||||||
|
style="fill:#e40000;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
|
||||||
|
<path
|
||||||
|
id="path6980"
|
||||||
|
d="M 53.816977,111.10486 L 103.21619,90.5207 L 107.33282,39.060543 L 53.816977,55.527708 L 53.816977,111.10486 z"
|
||||||
|
style="fill:#7fe719;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2.12364459;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="ccc"
|
||||||
|
id="path6982"
|
||||||
|
d="M 23.216626,81.319479 L 70.48573,67.361442 L 103.38422,90.444516"
|
||||||
|
style="opacity:1;fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
<path
|
||||||
|
sodipodi:nodetypes="cc"
|
||||||
|
id="path6984"
|
||||||
|
d="M 70.434539,17.875593 L 70.434539,66.984877"
|
||||||
|
style="opacity:1;fill:#babdb6;fill-rule:evenodd;stroke:#ffffff;stroke-width:1.25;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.8 KiB |
@@ -456,43 +456,33 @@ gtk_fishbowl_do_update (GtkFishbowl *fishbowl)
|
|||||||
{
|
{
|
||||||
GtkFishbowlPrivate *priv = gtk_fishbowl_get_instance_private (fishbowl);
|
GtkFishbowlPrivate *priv = gtk_fishbowl_get_instance_private (fishbowl);
|
||||||
GdkFrameClock *frame_clock;
|
GdkFrameClock *frame_clock;
|
||||||
GdkFrameTimings *start, *end;
|
GdkFrameTimings *end;
|
||||||
gint64 start_counter, end_counter;
|
gint64 end_counter;
|
||||||
gint64 n_frames, expected_frames;
|
double fps, expected_fps;
|
||||||
gint64 start_timestamp, end_timestamp;
|
|
||||||
gint64 interval;
|
gint64 interval;
|
||||||
|
|
||||||
frame_clock = gtk_widget_get_frame_clock (GTK_WIDGET (fishbowl));
|
frame_clock = gtk_widget_get_frame_clock (GTK_WIDGET (fishbowl));
|
||||||
if (frame_clock == NULL)
|
if (frame_clock == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
start_counter = gdk_frame_clock_get_history_start (frame_clock);
|
fps = gdk_frame_clock_get_fps (frame_clock);
|
||||||
end_counter = gdk_frame_clock_get_frame_counter (frame_clock);
|
if (fps <= 0.0)
|
||||||
start = gdk_frame_clock_get_timings (frame_clock, start_counter);
|
|
||||||
for (end = gdk_frame_clock_get_timings (frame_clock, end_counter);
|
|
||||||
end_counter > start_counter && end != NULL && !gdk_frame_timings_get_complete (end);
|
|
||||||
end = gdk_frame_clock_get_timings (frame_clock, end_counter))
|
|
||||||
end_counter--;
|
|
||||||
if (end_counter - start_counter < 4)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
start_timestamp = gdk_frame_timings_get_presentation_time (start);
|
priv->framerate = fps;
|
||||||
end_timestamp = gdk_frame_timings_get_presentation_time (end);
|
|
||||||
if (start_timestamp == 0 || end_timestamp == 0)
|
|
||||||
{
|
|
||||||
start_timestamp = gdk_frame_timings_get_frame_time (start);
|
|
||||||
end_timestamp = gdk_frame_timings_get_frame_time (end);
|
|
||||||
}
|
|
||||||
|
|
||||||
n_frames = end_counter - start_counter;
|
|
||||||
priv->framerate = ((double) n_frames) * G_USEC_PER_SEC / (end_timestamp - start_timestamp);
|
|
||||||
priv->framerate = ((int)(priv->framerate * 100))/100.0;
|
|
||||||
|
|
||||||
g_object_notify_by_pspec (G_OBJECT (fishbowl), props[PROP_FRAMERATE]);
|
g_object_notify_by_pspec (G_OBJECT (fishbowl), props[PROP_FRAMERATE]);
|
||||||
|
|
||||||
if (!priv->benchmark)
|
if (!priv->benchmark)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
end_counter = gdk_frame_clock_get_frame_counter (frame_clock);
|
||||||
|
for (end = gdk_frame_clock_get_timings (frame_clock, end_counter);
|
||||||
|
end != NULL && !gdk_frame_timings_get_complete (end);
|
||||||
|
end = gdk_frame_clock_get_timings (frame_clock, end_counter))
|
||||||
|
end_counter--;
|
||||||
|
if (end == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
interval = gdk_frame_timings_get_refresh_interval (end);
|
interval = gdk_frame_timings_get_refresh_interval (end);
|
||||||
if (interval == 0)
|
if (interval == 0)
|
||||||
{
|
{
|
||||||
@@ -500,16 +490,16 @@ gtk_fishbowl_do_update (GtkFishbowl *fishbowl)
|
|||||||
if (interval == 0)
|
if (interval == 0)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
expected_frames = round ((double) (end_timestamp - start_timestamp) / interval);
|
expected_fps = (double) G_USEC_PER_SEC / interval;
|
||||||
|
|
||||||
if (n_frames >= expected_frames)
|
if (fps > (expected_fps - 1))
|
||||||
{
|
{
|
||||||
if (priv->last_benchmark_change > 0)
|
if (priv->last_benchmark_change > 0)
|
||||||
priv->last_benchmark_change *= 2;
|
priv->last_benchmark_change *= 2;
|
||||||
else
|
else
|
||||||
priv->last_benchmark_change = 1;
|
priv->last_benchmark_change = 1;
|
||||||
}
|
}
|
||||||
else if (n_frames + 1 < expected_frames)
|
else if (0.95 * fps < expected_fps)
|
||||||
{
|
{
|
||||||
if (priv->last_benchmark_change < 0)
|
if (priv->last_benchmark_change < 0)
|
||||||
priv->last_benchmark_change--;
|
priv->last_benchmark_change--;
|
||||||
|
@@ -40,7 +40,7 @@ get_win32_all_locales_scripts (LPWSTR locale_w, DWORD flags, LPARAM param)
|
|||||||
{
|
{
|
||||||
wchar_t *langname_w = NULL;
|
wchar_t *langname_w = NULL;
|
||||||
wchar_t locale_abbrev_w[9];
|
wchar_t locale_abbrev_w[9];
|
||||||
gchar *langname, *locale_abbrev, *locale, *p;
|
gchar *langname, *locale_abbrev, *locale;
|
||||||
gint i;
|
gint i;
|
||||||
const LCTYPE iso639_lctypes[] = { LOCALE_SISO639LANGNAME, LOCALE_SISO639LANGNAME2 };
|
const LCTYPE iso639_lctypes[] = { LOCALE_SISO639LANGNAME, LOCALE_SISO639LANGNAME2 };
|
||||||
GHashTable *ht_scripts_langs = (GHashTable *) param;
|
GHashTable *ht_scripts_langs = (GHashTable *) param;
|
||||||
@@ -59,7 +59,6 @@ get_win32_all_locales_scripts (LPWSTR locale_w, DWORD flags, LPARAM param)
|
|||||||
GetLocaleInfoEx (locale_w, LOCALE_SLOCALIZEDDISPLAYNAME, langname_w, langname_size);
|
GetLocaleInfoEx (locale_w, LOCALE_SLOCALIZEDDISPLAYNAME, langname_w, langname_size);
|
||||||
langname = g_utf16_to_utf8 (langname_w, -1, NULL, NULL, NULL);
|
langname = g_utf16_to_utf8 (langname_w, -1, NULL, NULL, NULL);
|
||||||
locale = g_utf16_to_utf8 (locale_w, -1, NULL, NULL, NULL);
|
locale = g_utf16_to_utf8 (locale_w, -1, NULL, NULL, NULL);
|
||||||
p = strchr (locale, '-');
|
|
||||||
lang = pango_language_from_string (locale);
|
lang = pango_language_from_string (locale);
|
||||||
if (g_hash_table_lookup (ht_scripts_langs, lang) == NULL)
|
if (g_hash_table_lookup (ht_scripts_langs, lang) == NULL)
|
||||||
g_hash_table_insert (ht_scripts_langs, lang, langname);
|
g_hash_table_insert (ht_scripts_langs, lang, langname);
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include <glib/gstdio.h>
|
#include <glib/gstdio.h>
|
||||||
|
#include <glib/gi18n.h>
|
||||||
|
|
||||||
#include "demos.h"
|
#include "demos.h"
|
||||||
#include "fontify.h"
|
#include "fontify.h"
|
||||||
@@ -923,6 +924,34 @@ clear_search (GtkSearchBar *bar)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
search_results_update (GObject *filter_model,
|
||||||
|
GParamSpec *pspec,
|
||||||
|
GtkEntry *entry)
|
||||||
|
{
|
||||||
|
gsize n_items = g_list_model_get_n_items (G_LIST_MODEL (filter_model));
|
||||||
|
|
||||||
|
if (strlen (gtk_editable_get_text (GTK_EDITABLE (entry))) > 0)
|
||||||
|
{
|
||||||
|
char *text;
|
||||||
|
|
||||||
|
if (n_items > 0)
|
||||||
|
text = g_strdup_printf (ngettext ("%ld search result", "%ld search results", n_items), n_items);
|
||||||
|
else
|
||||||
|
text = g_strdup (_("No search results"));
|
||||||
|
|
||||||
|
gtk_accessible_update_property (GTK_ACCESSIBLE (entry),
|
||||||
|
GTK_ACCESSIBLE_PROPERTY_DESCRIPTION, text,
|
||||||
|
-1);
|
||||||
|
|
||||||
|
g_free (text);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gtk_accessible_reset_property (GTK_ACCESSIBLE (entry), GTK_ACCESSIBLE_PROPERTY_DESCRIPTION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
activate (GApplication *app)
|
activate (GApplication *app)
|
||||||
{
|
{
|
||||||
@@ -970,6 +999,7 @@ activate (GApplication *app)
|
|||||||
|
|
||||||
search_entry = GTK_WIDGET (gtk_builder_get_object (builder, "search-entry"));
|
search_entry = GTK_WIDGET (gtk_builder_get_object (builder, "search-entry"));
|
||||||
g_signal_connect (search_entry, "search-changed", G_CALLBACK (demo_search_changed_cb), filter);
|
g_signal_connect (search_entry, "search-changed", G_CALLBACK (demo_search_changed_cb), filter);
|
||||||
|
g_signal_connect (filter_model, "notify::n-items", G_CALLBACK (search_results_update), search_entry);
|
||||||
|
|
||||||
selection = gtk_single_selection_new (G_LIST_MODEL (filter_model));
|
selection = gtk_single_selection_new (G_LIST_MODEL (filter_model));
|
||||||
g_signal_connect (selection, "notify::selected-item", G_CALLBACK (selection_cb), NULL);
|
g_signal_connect (selection, "notify::selected-item", G_CALLBACK (selection_cb), NULL);
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
<interface>
|
<interface>
|
||||||
<menu id="menubar">
|
<menu id="menubar">
|
||||||
<submenu>
|
<submenu>
|
||||||
<attribute name="label" translatable="yes">_Application</attribute>
|
<attribute name="label" translatable="yes">_File</attribute>
|
||||||
<section>
|
<section>
|
||||||
<item>
|
<item>
|
||||||
<attribute name="label" translatable="yes">_New</attribute>
|
<attribute name="label" translatable="yes">_New</attribute>
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
</section>
|
</section>
|
||||||
</submenu>
|
</submenu>
|
||||||
<submenu>
|
<submenu>
|
||||||
<attribute name="label" translatable="yes">_File</attribute>
|
<attribute name="label" translatable="yes">_Preferences</attribute>
|
||||||
<section>
|
<section>
|
||||||
<item>
|
<item>
|
||||||
<attribute name="label" translatable="yes">_Prefer Dark Theme</attribute>
|
<attribute name="label" translatable="yes">_Prefer Dark Theme</attribute>
|
||||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@@ -338,7 +338,7 @@ do_path_maze (GtkWidget *do_widget)
|
|||||||
GskPath *path;
|
GskPath *path;
|
||||||
|
|
||||||
window = gtk_window_new ();
|
window = gtk_window_new ();
|
||||||
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
|
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||||
gtk_window_set_title (GTK_WINDOW (window), "Follow the maze with the mouse");
|
gtk_window_set_title (GTK_WINDOW (window), "Follow the maze with the mouse");
|
||||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -120,7 +120,7 @@ create_shadertoy_window (GtkWidget *do_widget)
|
|||||||
gtk_box_append (GTK_BOX (box), aspect);
|
gtk_box_append (GTK_BOX (box), aspect);
|
||||||
|
|
||||||
shadertoy = new_shadertoy ("/shadertoy/alienplanet.glsl");
|
shadertoy = new_shadertoy ("/shadertoy/alienplanet.glsl");
|
||||||
gtk_aspect_frame_set_child (GTK_ASPECT_FRAME (aspect), shadertoy);
|
gtk_aspect_frame_set_child (GTK_ASPECT_FRAME (aspect), gtk_graphics_offload_new (shadertoy));
|
||||||
|
|
||||||
sw = gtk_scrolled_window_new ();
|
sw = gtk_scrolled_window_new ();
|
||||||
gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (sw), 250);
|
gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (sw), 250);
|
||||||
|
@@ -330,6 +330,7 @@ stroke bounds of the path.
|
|||||||
| offset | `<point>` | 0 0 | non-default |
|
| offset | `<point>` | 0 0 | non-default |
|
||||||
| hint-style | `<hint style>` | slight | non-default |
|
| hint-style | `<hint style>` | slight | non-default |
|
||||||
| antialias | `<antialias>` | gray | non-default |
|
| antialias | `<antialias>` | gray | non-default |
|
||||||
|
| hint-metrics | `<hint metrics>` | off | non-default |
|
||||||
|
|
||||||
Creates a node like `gsk_text_node_new()` with the given properties.
|
Creates a node like `gsk_text_node_new()` with the given properties.
|
||||||
|
|
||||||
@@ -346,6 +347,7 @@ font, an error node will be returned.
|
|||||||
|
|
||||||
Possible values for hint-style are none, slight or full.
|
Possible values for hint-style are none, slight or full.
|
||||||
Possible value for antialias are none or gray.
|
Possible value for antialias are none or gray.
|
||||||
|
Possible value for hint-metrics are on or off.
|
||||||
|
|
||||||
### texture
|
### texture
|
||||||
|
|
||||||
|
@@ -5,8 +5,11 @@ Title: Cairo interaction
|
|||||||
[Cairo](http://cairographics.org) is a graphics library that supports vector
|
[Cairo](http://cairographics.org) is a graphics library that supports vector
|
||||||
graphics and image compositing that can be used with GTK.
|
graphics and image compositing that can be used with GTK.
|
||||||
|
|
||||||
GDK does not wrap the Cairo API; instead it allows to create Cairo
|
GDK does not wrap the Cairo API and it is not possible to use cairo directly
|
||||||
drawing contexts which can be used to draw on [class@Gdk.Surface]s.
|
to draw on a [class@Gdk.Surface]. You can either use a
|
||||||
|
[GtkDrawingArea](../gtk4/class.DrawingArea.html) widget or
|
||||||
|
[gtk_snapshot_append_cairo](../gtk4/func.Snapshot.append_cairo.html)
|
||||||
|
for drawing with cairo in a GTK4 application.
|
||||||
|
|
||||||
Additional functions allow use [struct@Gdk.Rectangle]s with Cairo
|
Additional functions allow use [struct@Gdk.Rectangle]s with Cairo
|
||||||
and to use [struct@Gdk.RGBA], `GdkPixbuf`, and [class@Gdk.Surface]
|
and to use [struct@Gdk.RGBA], `GdkPixbuf`, and [class@Gdk.Surface]
|
||||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@@ -38,13 +38,13 @@ can run the build, using Ninja:
|
|||||||
|
|
||||||
```
|
```
|
||||||
cd builddir
|
cd builddir
|
||||||
ninja
|
meson compile
|
||||||
ninja install
|
meson install
|
||||||
```
|
```
|
||||||
|
|
||||||
If you don't have permission to write to the directory you are
|
If you don't have permission to write to the directory you are
|
||||||
installing in, you may have to change to root temporarily before
|
installing in, you may have to change to root temporarily before
|
||||||
running `ninja install`.
|
running `meson install`.
|
||||||
|
|
||||||
Several environment variables are useful to pass to set before
|
Several environment variables are useful to pass to set before
|
||||||
running *meson*. `CPPFLAGS` contains options to pass to the C
|
running *meson*. `CPPFLAGS` contains options to pass to the C
|
||||||
@@ -112,10 +112,10 @@ responsible for controlling the debugging features of GTK with
|
|||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
Before you can compile the GTK widget toolkit, you need to have
|
Before you can compile GTK, you need to have various other tools and
|
||||||
various other tools and libraries installed on your
|
libraries installed on your system. Dependencies of GTK have their own
|
||||||
system. Dependencies of GTK have their own build systems, so
|
build systems, so you will need to refer to their own installation
|
||||||
you will need to refer to their own installation instructions.
|
instructions.
|
||||||
|
|
||||||
A particular important tool used by GTK to find its dependencies
|
A particular important tool used by GTK to find its dependencies
|
||||||
is `pkg-config`.
|
is `pkg-config`.
|
||||||
@@ -156,8 +156,8 @@ Other libraries are maintained separately.
|
|||||||
the development environment for these libraries that your
|
the development environment for these libraries that your
|
||||||
operating system vendor provides.
|
operating system vendor provides.
|
||||||
- The [fontconfig](https://www.freedesktop.org/wiki/Software/fontconfig/)
|
- The [fontconfig](https://www.freedesktop.org/wiki/Software/fontconfig/)
|
||||||
library provides Pango with a standard way of locating
|
library provides Pango with a standard way of locating fonts and matching
|
||||||
fonts and matching them against font names.
|
them against font names.
|
||||||
- [Cairo](https://www.cairographics.org) is a graphics library that
|
- [Cairo](https://www.cairographics.org) is a graphics library that
|
||||||
supports vector graphics and image compositing. Both Pango and GTK
|
supports vector graphics and image compositing. Both Pango and GTK
|
||||||
use Cairo for drawing. Note that we also need the auxiliary cairo-gobject
|
use Cairo for drawing. Note that we also need the auxiliary cairo-gobject
|
||||||
@@ -220,13 +220,12 @@ meson configure builddir
|
|||||||
|
|
||||||
### `x11-backend`, `win32-backend`, `broadway-backend`, `wayland-backend` and `macos-backend`
|
### `x11-backend`, `win32-backend`, `broadway-backend`, `wayland-backend` and `macos-backend`
|
||||||
|
|
||||||
Enable specific backends for GDK. If none of these options
|
Enable specific backends for GDK. If none of these options are given, the
|
||||||
are given, the Wayland backend will be enabled by default,
|
Wayland backend will be enabled by default, if the platform is Linux; the
|
||||||
if the platform is Linux; the X11 backend will also be enabled
|
X11 backend will also be enabled by default, unless the platform is Windows,
|
||||||
by default, unless the platform is Windows, in which case the
|
in which case the default is win32, or the platform is macOS, in which case
|
||||||
default is win32, or the platform is macOS, in which case the
|
the default is macOS. If any backend is explicitly enabled or disabled, no
|
||||||
default is macOS. If any backend is explicitly enabled or disabled,
|
other platform will be enabled automatically.
|
||||||
no other platform will be enabled automatically.
|
|
||||||
|
|
||||||
### `vulkan`
|
### `vulkan`
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
Title: CSS in GTK
|
Title: CSS in GTK
|
||||||
Slug: css
|
Slug: css
|
||||||
|
|
||||||
This chapter describes how GTK uses CSS for styling and layout.
|
This chapter describes how GTK uses CSS for styling and layout.
|
||||||
It is not meant to be an explanation of CSS from first principles,
|
It is not meant to be an explanation of CSS from first principles,
|
||||||
but focuses on listing supported CSS features and differences
|
but focuses on listing supported CSS features and differences
|
||||||
between Web CSS and GTK.
|
between Web CSS and GTK.
|
||||||
@@ -74,6 +74,7 @@ in a selector, widget names must be prefixed with a # character.
|
|||||||
| E:not(selector) | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#negation) | |
|
| E:not(selector) | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#negation) | |
|
||||||
| E:dir(ltr), E:dir(rtl) | [CSS Selector Level 4](https://drafts.csswg.org/selectors/#the-dir-pseudo) | |
|
| E:dir(ltr), E:dir(rtl) | [CSS Selector Level 4](https://drafts.csswg.org/selectors/#the-dir-pseudo) | |
|
||||||
| E:drop(active) | [CSS Selector Level 4](https://drafts.csswg.org/selectors/#drag-pseudos) | |
|
| E:drop(active) | [CSS Selector Level 4](https://drafts.csswg.org/selectors/#drag-pseudos) | |
|
||||||
|
| E:root | [CSS Selector Level 3](https://www.w3.org/TR/selectors-3/#root-pseudo) | |
|
||||||
| E F | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#descendent-combinators) | |
|
| E F | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#descendent-combinators) | |
|
||||||
| E > F | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#child-combinators) | |
|
| E > F | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#child-combinators) | |
|
||||||
| E ~ F | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#general-sibling-combinators) | |
|
| E ~ F | [CSS Selector Level 3](https://www.w3.org/TR/css3-selectors/#general-sibling-combinators) | |
|
||||||
|
@@ -56,6 +56,30 @@ follows:
|
|||||||
1 value:
|
1 value:
|
||||||
: all
|
: all
|
||||||
|
|
||||||
|
## Custom Properties
|
||||||
|
|
||||||
|
GTK supports custom properties as defined in the
|
||||||
|
[CSS Custom Properties for Cascading Variables](https://www.w3.org/TR/css-variables-1)
|
||||||
|
spec.
|
||||||
|
|
||||||
|
Custom properties are defined as follows:
|
||||||
|
|
||||||
|
```css
|
||||||
|
--prop: red;
|
||||||
|
```
|
||||||
|
|
||||||
|
and used via the `var` keyword:
|
||||||
|
|
||||||
|
```css
|
||||||
|
color: var(--prop);
|
||||||
|
```
|
||||||
|
|
||||||
|
Custom properties can have a fallback for when the referred property is invalid:
|
||||||
|
|
||||||
|
```css
|
||||||
|
color: var(--prop, green);
|
||||||
|
```
|
||||||
|
|
||||||
## Colors
|
## Colors
|
||||||
|
|
||||||
GTK extends the CSS syntax with several additional ways to specify colors.
|
GTK extends the CSS syntax with several additional ways to specify colors.
|
||||||
|
@@ -8,6 +8,10 @@ gtk4-broadwayd
|
|||||||
The Broadway display server
|
The Broadway display server
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
|
:Version: GTK
|
||||||
|
:Manual section: 1
|
||||||
|
:Manual group: GTK commands
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
| **gtk4-broadwayd** [OPTIONS...] <DISPLAY>
|
| **gtk4-broadwayd** [OPTIONS...] <DISPLAY>
|
||||||
|
@@ -8,6 +8,10 @@ gtk4-builder-tool
|
|||||||
GtkBuilder File Utility
|
GtkBuilder File Utility
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
|
:Version: GTK
|
||||||
|
:Manual section: 1
|
||||||
|
:Manual group: GTK commands
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
| **gtk4-builder-tool** <COMMAND> [OPTIONS...] <FILE>
|
| **gtk4-builder-tool** <COMMAND> [OPTIONS...] <FILE>
|
||||||
|
@@ -8,6 +8,9 @@ gtk4-demo-application
|
|||||||
Demonstrate GtkApplication
|
Demonstrate GtkApplication
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
|
:Version: GTK
|
||||||
|
:Manual section: 1
|
||||||
|
:Manual group: GTK commands
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
|
@@ -8,6 +8,10 @@ gtk4-demo
|
|||||||
Demonstrate GTK widgets
|
Demonstrate GTK widgets
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
|
:Version: GTK
|
||||||
|
:Manual section: 1
|
||||||
|
:Manual group: GTK commands
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@@ -8,6 +8,10 @@ gtk4-encode-symbolic-svg
|
|||||||
Symbolic icon conversion utility
|
Symbolic icon conversion utility
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
|
:Version: GTK
|
||||||
|
:Manual section: 1
|
||||||
|
:Manual group: GTK commands
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@@ -8,6 +8,10 @@ gtk4-icon-browser
|
|||||||
List themed icons
|
List themed icons
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
:Version: GTK
|
||||||
|
:Manual section: 1
|
||||||
|
:Manual group: GTK commands
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@@ -8,6 +8,10 @@ gtk4-launch
|
|||||||
Launch an application
|
Launch an application
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
:Version: GTK
|
||||||
|
:Manual section: 1
|
||||||
|
:Manual group: GTK commands
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@@ -8,6 +8,10 @@ gtk4-node-editor
|
|||||||
Editor render nodes
|
Editor render nodes
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
:Version: GTK
|
||||||
|
:Manual section: 1
|
||||||
|
:Manual group: GTK commands
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@@ -8,6 +8,10 @@ gtk4-path-tool
|
|||||||
GskPath Utility
|
GskPath Utility
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
|
:Version: GTK
|
||||||
|
:Manual section: 1
|
||||||
|
:Manual group: GTK commands
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
| **gtk4-path-tool** <COMMAND> [OPTIONS...] <PATH>
|
| **gtk4-path-tool** <COMMAND> [OPTIONS...] <PATH>
|
||||||
|
@@ -8,6 +8,10 @@ gtk4-query-settings
|
|||||||
Print name and value of GTK settings
|
Print name and value of GTK settings
|
||||||
------------------------------------
|
------------------------------------
|
||||||
|
|
||||||
|
:Version: GTK
|
||||||
|
:Manual section: 1
|
||||||
|
:Manual group: GTK commands
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@@ -8,6 +8,10 @@ gtk4-rendernode-tool
|
|||||||
GskRenderNode Utility
|
GskRenderNode Utility
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
|
:Version: GTK
|
||||||
|
:Manual section: 1
|
||||||
|
:Manual group: GTK commands
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
| **gtk4-rendernode-tool** <COMMAND> [OPTIONS...] <FILE>
|
| **gtk4-rendernode-tool** <COMMAND> [OPTIONS...] <FILE>
|
||||||
@@ -45,13 +49,14 @@ without any titlebar.
|
|||||||
Rendering
|
Rendering
|
||||||
^^^^^^^^^
|
^^^^^^^^^
|
||||||
|
|
||||||
The ``render`` command saves a rendering of the rendernode as a png or tiff image.
|
The ``render`` command saves a rendering of the rendernode as a png, tiff or svg
|
||||||
The name of the file to write can be specified as a second FILE argument.
|
image or as pdf document. The name of the file to write can be specified as a second
|
||||||
|
FILE argument.
|
||||||
|
|
||||||
``--renderer=RENDERER``
|
``--renderer=RENDERER``
|
||||||
|
|
||||||
Use the given renderer. Use ``--renderer=help`` to get a information
|
Use the given renderer. Use ``--renderer=help`` to get a information
|
||||||
about poassible values for the ``RENDERER``.
|
about possible values for the ``RENDERER``.
|
||||||
|
|
||||||
Benchmark
|
Benchmark
|
||||||
^^^^^^^^^
|
^^^^^^^^^
|
||||||
@@ -93,4 +98,4 @@ exit code is 1. If the images are identical, it is 0.
|
|||||||
|
|
||||||
``--quiet``
|
``--quiet``
|
||||||
|
|
||||||
Don't write results to stdout.`
|
Don't write results to stdout.
|
||||||
|
@@ -8,6 +8,10 @@ gtk4-update-icon-cache
|
|||||||
Icon theme caching utility
|
Icon theme caching utility
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|
||||||
|
:Version: GTK
|
||||||
|
:Manual section: 1
|
||||||
|
:Manual group: GTK commands
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@@ -8,6 +8,10 @@ gtk4-widget-factory
|
|||||||
Showcase GTK widgets and styles
|
Showcase GTK widgets and styles
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
|
||||||
|
:Version: GTK
|
||||||
|
:Manual section: 1
|
||||||
|
:Manual group: GTK commands
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@@ -80,7 +80,7 @@ if get_option('man-pages') and rst2man.found()
|
|||||||
[ 'gtk4-path-tool', '1', ],
|
[ 'gtk4-path-tool', '1', ],
|
||||||
]
|
]
|
||||||
|
|
||||||
if get_option('demos')
|
if get_option('build-demos')
|
||||||
rst_files += [
|
rst_files += [
|
||||||
[ 'gtk4-demo', '1', ],
|
[ 'gtk4-demo', '1', ],
|
||||||
[ 'gtk4-demo-application', '1', ],
|
[ 'gtk4-demo-application', '1', ],
|
||||||
|
@@ -28,6 +28,9 @@ GTK depends on the following libraries:
|
|||||||
- **OpenGL**: OpenGL is the premier environment for developing portable,
|
- **OpenGL**: OpenGL is the premier environment for developing portable,
|
||||||
interactive 2D and 3D graphics applications. More information available
|
interactive 2D and 3D graphics applications. More information available
|
||||||
on the [Khronos website][opengl].
|
on the [Khronos website][opengl].
|
||||||
|
- **Vulkan**: Vulkan is the a newer graphics API, that can be considered
|
||||||
|
the successor of OpenGL. More information available on the
|
||||||
|
[Khronos website][vulkan].
|
||||||
- **Pango**: Pango is a library for internationalized text handling. It
|
- **Pango**: Pango is a library for internationalized text handling. It
|
||||||
centers around the `PangoLayout` object, representing a paragraph of
|
centers around the `PangoLayout` object, representing a paragraph of
|
||||||
text. Pango provides the engine for `GtkTextView`, `GtkLabel`,
|
text. Pango provides the engine for `GtkTextView`, `GtkLabel`,
|
||||||
@@ -55,11 +58,12 @@ GTK is divided into three parts:
|
|||||||
storage types for efficient use in GUI applications, and much more.
|
storage types for efficient use in GUI applications, and much more.
|
||||||
|
|
||||||
[gnu-lgpl]: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
|
[gnu-lgpl]: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
|
||||||
[glib]: https://developer.gnome.org/glib/stable/
|
[glib]: https://docs.gtk.org/glib/
|
||||||
[gobject]: https://developer.gnome.org/gobject/stable/
|
[gobject]: https://docs.gtk.org/gobject/
|
||||||
[gio]: https://developer.gnome.org/gio/stable/
|
[gio]: https://docs.gtk.org/gio/
|
||||||
[cairo]: https://www.cairographics.org/manual/
|
[cairo]: https://www.cairographics.org/manual/
|
||||||
[opengl]: https://www.opengl.org/about/
|
[opengl]: https://www.opengl.org/about/
|
||||||
[pango]: https://pango.gnome.org/
|
[vulkan]: https://www.vulkan.org/
|
||||||
[gdkpixbuf]: https://developer.gnome.org/gdk-pixbuf/stable/
|
[pango]: https://docs.gtk.org/pango/
|
||||||
|
[gdkpixbuf]: https://docs.gtk.org/gdk-pixbuf/
|
||||||
[graphene]: https://ebassi.github.io/graphene/
|
[graphene]: https://ebassi.github.io/graphene/
|
||||||
|
@@ -27,7 +27,7 @@ the question you have, this list is a good place to start.
|
|||||||
Every major version of GTK comes with a [migration guide](#migrating). You may also
|
Every major version of GTK comes with a [migration guide](#migrating). You may also
|
||||||
find useful information in the documentation for specific widgets and functions. If
|
find useful information in the documentation for specific widgets and functions. If
|
||||||
you have a question not covered in the manual, feel free to ask, and please
|
you have a question not covered in the manual, feel free to ask, and please
|
||||||
[file a bug report](https://gitlab.gnome.org/GNOME/gtk/issues/new) against the
|
[file a bug report](https://gitlab.gnome.org/GNOME/gtk/issues/) against the
|
||||||
documentation.
|
documentation.
|
||||||
|
|
||||||
* Should I maintain parallel versions of my UI in GTK x and GTK y?
|
* Should I maintain parallel versions of my UI in GTK x and GTK y?
|
||||||
@@ -54,7 +54,7 @@ the question you have, this list is a good place to start.
|
|||||||
For strings returned from functions, they will be declared "const" if they should
|
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
|
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
|
same rule. If you find an undocumented exception to the rules, please
|
||||||
[file a bug report.](https://gitlab.gnome.org/GNOME/gtk/issues/new).
|
[file a bug report.](https://gitlab.gnome.org/GNOME/gtk/issues/).
|
||||||
|
|
||||||
The transfer annotations for gobject-introspection that are part of the
|
The transfer annotations for gobject-introspection that are part of the
|
||||||
documentation can provide useful hints for memory handling semantics as well.
|
documentation can provide useful hints for memory handling semantics as well.
|
||||||
|
@@ -4,7 +4,7 @@ Slug: gtk-resources
|
|||||||
## Opening a bug or feature request
|
## Opening a bug or feature request
|
||||||
|
|
||||||
If you encounter a bug, misfeature, or missing feature in GTK, please
|
If you encounter a bug, misfeature, or missing feature in GTK, please
|
||||||
file a bug report on our [GitLab project](https://gitlab.gnome.org/GNOME/gtk/issues/new).
|
file a bug report on our [GitLab project](https://gitlab.gnome.org/GNOME/gtk/issues/).
|
||||||
You should also file issues if the documentation is out of date with the
|
You should also file issues if the documentation is out of date with the
|
||||||
existing API, or unclear.
|
existing API, or unclear.
|
||||||
|
|
||||||
|
@@ -217,6 +217,10 @@ A number of options affect behavior instead of logging:
|
|||||||
`no-portals`
|
`no-portals`
|
||||||
: Disable use of [portals](https://docs.flatpak.org/en/latest/portals.html)
|
: Disable use of [portals](https://docs.flatpak.org/en/latest/portals.html)
|
||||||
|
|
||||||
|
`force-offload`
|
||||||
|
: Force graphics offload for all textures, even when slower. This allows
|
||||||
|
to debug offloading in the absence of dmabufs.
|
||||||
|
|
||||||
`gl-disable`
|
`gl-disable`
|
||||||
: Disable OpenGL support
|
: Disable OpenGL support
|
||||||
|
|
||||||
@@ -278,14 +282,11 @@ are only available when GTK has been configured with `-Ddebug=true`.
|
|||||||
: OpenGL renderer information
|
: OpenGL renderer information
|
||||||
|
|
||||||
`vulkan`
|
`vulkan`
|
||||||
: Vulkan renderer information
|
: Check Vulkan errors
|
||||||
|
|
||||||
`shaders`
|
`shaders`
|
||||||
: Information about shaders
|
: Information about shaders
|
||||||
|
|
||||||
`surface`
|
|
||||||
: Information about surfaces
|
|
||||||
|
|
||||||
`fallback`
|
`fallback`
|
||||||
: Information about fallback usage in renderers
|
: Information about fallback usage in renderers
|
||||||
|
|
||||||
@@ -303,9 +304,6 @@ A number of options affect behavior instead of logging:
|
|||||||
`full-redraw`
|
`full-redraw`
|
||||||
: Force full redraws
|
: Force full redraws
|
||||||
|
|
||||||
`sync`
|
|
||||||
: Sync after each frame
|
|
||||||
|
|
||||||
`staging`
|
`staging`
|
||||||
: Use a staging image for texture upload (Vulkan only)
|
: Use a staging image for texture upload (Vulkan only)
|
||||||
|
|
||||||
@@ -347,6 +345,28 @@ a `*`, which means: try all remaining backends. The special value
|
|||||||
backends. For more information about selecting backends,
|
backends. For more information about selecting backends,
|
||||||
see the [func@Gdk.DisplayManager.get] function.
|
see the [func@Gdk.DisplayManager.get] function.
|
||||||
|
|
||||||
|
### `GDK_GL_DISABLE`
|
||||||
|
|
||||||
|
This variable can be set to a list of values, which cause GDK to
|
||||||
|
disable extension features of the OpenGL support.
|
||||||
|
Note that these features may already be disabled if the GL driver
|
||||||
|
does not support them.
|
||||||
|
|
||||||
|
`debug`
|
||||||
|
: GL_KHR_debug
|
||||||
|
|
||||||
|
`unpack-subimage`
|
||||||
|
:GL_EXT_unpack_subimage
|
||||||
|
|
||||||
|
`half-float`
|
||||||
|
:GL_OES_vertex_half_float
|
||||||
|
|
||||||
|
`sync`
|
||||||
|
:GL_ARB_sync
|
||||||
|
|
||||||
|
`base-instance`
|
||||||
|
:GL_EXT_base_instance
|
||||||
|
|
||||||
### `GDK_VULKAN_DEVICE`
|
### `GDK_VULKAN_DEVICE`
|
||||||
|
|
||||||
This variable can be set to the index of a Vulkan device to override
|
This variable can be set to the index of a Vulkan device to override
|
||||||
@@ -354,7 +374,7 @@ the default selection of the device that is used for Vulkan rendering.
|
|||||||
The special value `list` can be used to obtain a list of all Vulkan
|
The special value `list` can be used to obtain a list of all Vulkan
|
||||||
devices.
|
devices.
|
||||||
|
|
||||||
### `GDK_VULKAN_SKIP`
|
### `GDK_VULKAN_DISABLE`
|
||||||
|
|
||||||
This variable can be set to a list of values, which cause GDK to
|
This variable can be set to a list of values, which cause GDK to
|
||||||
disable features of the Vulkan support.
|
disable features of the Vulkan support.
|
||||||
@@ -434,7 +454,7 @@ using and the GDK backend supports them:
|
|||||||
installation.
|
installation.
|
||||||
|
|
||||||
|
|
||||||
### `GSK_GPU_SKIP`
|
### `GSK_GPU_DISABLE`
|
||||||
|
|
||||||
This variable can be set to a list of values, which cause GSK to
|
This variable can be set to a list of values, which cause GSK to
|
||||||
disable certain optimizations of the "ngl" and "vulkan" renderer.
|
disable certain optimizations of the "ngl" and "vulkan" renderer.
|
||||||
@@ -454,9 +474,6 @@ disable certain optimizations of the "ngl" and "vulkan" renderer.
|
|||||||
`mipmap`
|
`mipmap`
|
||||||
: Avoid creating mipmaps
|
: Avoid creating mipmaps
|
||||||
|
|
||||||
`gl-baseinstance`
|
|
||||||
: Assume no ARB/EXT_base_instance support
|
|
||||||
|
|
||||||
The special value `all` can be used to turn on all values. The special
|
The special value `all` can be used to turn on all values. The special
|
||||||
value `help` can be used to obtain a list of all supported values.
|
value `help` can be used to obtain a list of all supported values.
|
||||||
|
|
||||||
@@ -469,10 +486,10 @@ n seconds. The default timeout is 15 seconds.
|
|||||||
|
|
||||||
### `GSK_MAX_TEXTURE_SIZE`
|
### `GSK_MAX_TEXTURE_SIZE`
|
||||||
|
|
||||||
Limit texture size to the minimum of this value and the OpenGL limit
|
Limit texture size to the minimum of this value and the OpenGL limit for
|
||||||
for texture sizes. This can be used to debug issues with texture slicing
|
texture sizes in the "gl" renderer. This can be used to debug issues with
|
||||||
on systems where the OpenGL texture size limit would otherwise make
|
texture slicing on systems where the OpenGL texture size limit would
|
||||||
texture slicing difficult to test.
|
otherwise make texture slicing difficult to test.
|
||||||
|
|
||||||
### `GTK_CSD`
|
### `GTK_CSD`
|
||||||
|
|
||||||
|
@@ -155,6 +155,7 @@ Each property name is part of the `GtkAccessibleProperty` enumeration.
|
|||||||
| %GTK_ACCESSIBLE_PROPERTY_VALUE_MIN | “aria-valuemin” | double |
|
| %GTK_ACCESSIBLE_PROPERTY_VALUE_MIN | “aria-valuemin” | double |
|
||||||
| %GTK_ACCESSIBLE_PROPERTY_VALUE_NOW | “aria-valuenow” | double |
|
| %GTK_ACCESSIBLE_PROPERTY_VALUE_NOW | “aria-valuenow” | double |
|
||||||
| %GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT | “aria-valuetext” | translatable string |
|
| %GTK_ACCESSIBLE_PROPERTY_VALUE_TEXT | “aria-valuetext” | translatable string |
|
||||||
|
| %GTK_ACCESSIBLE_PROPERTY_HELP_TEXT | N/A | translatable string |
|
||||||
|
|
||||||
#### List of accessible relations
|
#### List of accessible relations
|
||||||
|
|
||||||
@@ -216,6 +217,10 @@ are accessible as part of the development process. The GTK Inspector shows
|
|||||||
the accessible attributes of each widget, and also provides an overlay that
|
the accessible attributes of each widget, and also provides an overlay that
|
||||||
can highlight accessibility issues.
|
can highlight accessibility issues.
|
||||||
|
|
||||||
|
If you support some non-standard keyboard interactions for a widget, you
|
||||||
|
**should** set an appropriate `GTK_ACCESSIBLE_PROPERTY_HELP_TEXT` to help
|
||||||
|
discoverability of the behavior.
|
||||||
|
|
||||||
It is possible to set accessible attributes in UI files as well:
|
It is possible to set accessible attributes in UI files as well:
|
||||||
```xml
|
```xml
|
||||||
<object class="GtkButton" id="button1">
|
<object class="GtkButton" id="button1">
|
||||||
|
@@ -91,6 +91,31 @@ const GDK_META_MASK = 1 << 28;
|
|||||||
|
|
||||||
var useDataUrls = window.location.search.includes("datauri");
|
var useDataUrls = window.location.search.includes("datauri");
|
||||||
|
|
||||||
|
/* 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;
|
||||||
|
}
|
||||||
|
|
||||||
/* This base64code is based on https://github.com/beatgammit/base64-js/blob/master/index.js which is MIT licensed */
|
/* This base64code is based on https://github.com/beatgammit/base64-js/blob/master/index.js which is MIT licensed */
|
||||||
|
|
||||||
var b64_lookup = [];
|
var b64_lookup = [];
|
||||||
@@ -215,11 +240,32 @@ function logStackTrace(len) {
|
|||||||
log(callstack[i]);
|
log(callstack[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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;
|
||||||
|
}
|
||||||
|
|
||||||
var grab = new Object();
|
var grab = new Object();
|
||||||
grab.surface = null;
|
grab.surface = null;
|
||||||
grab.ownerEvents = false;
|
grab.ownerEvents = false;
|
||||||
grab.implicit = false;
|
grab.implicit = false;
|
||||||
var keyDownList = [];
|
var keyDownList = [];
|
||||||
|
var inputList = [];
|
||||||
var lastSerial = 0;
|
var lastSerial = 0;
|
||||||
var lastX = 0;
|
var lastX = 0;
|
||||||
var lastY = 0;
|
var lastY = 0;
|
||||||
@@ -987,7 +1033,14 @@ function handleDisplayCommands(display_commands)
|
|||||||
break;
|
break;
|
||||||
case DISPLAY_OP_DELETE_SURFACE:
|
case DISPLAY_OP_DELETE_SURFACE:
|
||||||
var id = cmd[1];
|
var id = cmd[1];
|
||||||
delete surfaces[id];
|
if (id == surfaceWithMouse) {
|
||||||
|
surfaceWithMouse = 0;
|
||||||
|
}
|
||||||
|
if (id == realSurfaceWithMouse) {
|
||||||
|
realSurfaceWithMouse = 0;
|
||||||
|
firstTouchDownId = null;
|
||||||
|
}
|
||||||
|
delete surfaces[id];
|
||||||
break;
|
break;
|
||||||
case DISPLAY_OP_CHANGE_TEXTURE:
|
case DISPLAY_OP_CHANGE_TEXTURE:
|
||||||
var image = cmd[1];
|
var image = cmd[1];
|
||||||
@@ -1371,8 +1424,14 @@ function getEffectiveEventTarget (id) {
|
|||||||
function updateKeyboardStatus() {
|
function updateKeyboardStatus() {
|
||||||
if (fakeInput != null && showKeyboardChanged) {
|
if (fakeInput != null && showKeyboardChanged) {
|
||||||
showKeyboardChanged = false;
|
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();
|
fakeInput.focus();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
fakeInput.blur();
|
fakeInput.blur();
|
||||||
}
|
}
|
||||||
@@ -2924,6 +2983,19 @@ function pushKeyEvent(fev) {
|
|||||||
keyDownList.push(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) {
|
function getKeyEvent(keyCode, pop) {
|
||||||
var i, fev = null;
|
var i, fev = null;
|
||||||
for (i = keyDownList.length-1; i >= 0; i--) {
|
for (i = keyDownList.length-1; i >= 0; i--) {
|
||||||
@@ -3022,6 +3094,29 @@ function handleKeyUp(e) {
|
|||||||
keysym = fev.keysym;
|
keysym = fev.keysym;
|
||||||
else {
|
else {
|
||||||
//log("Key event (keyCode = " + ev.keyCode + ") not found on keyDownList");
|
//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(BROADWAY_EVENT_KEY_PRESS, [65288, lastState]);
|
||||||
|
sendInput(BROADWAY_EVENT_KEY_RELEASE, [65288, lastState]);
|
||||||
|
break;
|
||||||
|
case "insertText":
|
||||||
|
if (fev.data !== undefined) {
|
||||||
|
for (let sym of fev.data) {
|
||||||
|
sendInput(BROADWAY_EVENT_KEY_PRESS, [sym.codePointAt(0), lastState]);
|
||||||
|
sendInput(BROADWAY_EVENT_KEY_RELEASE, [sym.codePointAt(0), lastState]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
inputList.splice(0, len);
|
||||||
|
}
|
||||||
keysym = 0;
|
keysym = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3030,6 +3125,16 @@ function handleKeyUp(e) {
|
|||||||
return cancelEvent(ev);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
function onKeyDown (ev) {
|
function onKeyDown (ev) {
|
||||||
updateForEvent(ev);
|
updateForEvent(ev);
|
||||||
return handleKeyDown(ev);
|
return handleKeyDown(ev);
|
||||||
@@ -3045,6 +3150,11 @@ function onKeyUp (ev) {
|
|||||||
return handleKeyUp(ev);
|
return handleKeyUp(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onInput (ev) {
|
||||||
|
updateForEvent(ev);
|
||||||
|
return handleInput(ev);
|
||||||
|
}
|
||||||
|
|
||||||
function cancelEvent(ev)
|
function cancelEvent(ev)
|
||||||
{
|
{
|
||||||
ev = ev ? ev : window.event;
|
ev = ev ? ev : window.event;
|
||||||
@@ -3076,13 +3186,14 @@ function onMouseWheel(ev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onTouchStart(ev) {
|
function onTouchStart(ev) {
|
||||||
event.preventDefault();
|
ev.preventDefault();
|
||||||
|
|
||||||
updateKeyboardStatus();
|
updateKeyboardStatus();
|
||||||
updateForEvent(ev);
|
updateForEvent(ev);
|
||||||
|
|
||||||
for (var i = 0; i < ev.changedTouches.length; i++) {
|
for (var i = 0; i < ev.changedTouches.length; i++) {
|
||||||
var touch = ev.changedTouches.item(i);
|
var touch = ev.changedTouches.item(i);
|
||||||
|
var touchId = touchIdentifierStart(touch.identifier);
|
||||||
|
|
||||||
var origId = getSurfaceId(touch);
|
var origId = getSurfaceId(touch);
|
||||||
var id = getEffectiveEventTarget (origId);
|
var id = getEffectiveEventTarget (origId);
|
||||||
@@ -3090,7 +3201,7 @@ function onTouchStart(ev) {
|
|||||||
var isEmulated = 0;
|
var isEmulated = 0;
|
||||||
|
|
||||||
if (firstTouchDownId == null) {
|
if (firstTouchDownId == null) {
|
||||||
firstTouchDownId = touch.identifier;
|
firstTouchDownId = touchId;
|
||||||
isEmulated = 1;
|
isEmulated = 1;
|
||||||
|
|
||||||
if (realSurfaceWithMouse != origId || id != surfaceWithMouse) {
|
if (realSurfaceWithMouse != origId || id != surfaceWithMouse) {
|
||||||
@@ -3105,52 +3216,54 @@ function onTouchStart(ev) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sendInput (BROADWAY_EVENT_TOUCH, [0, id, touch.identifier, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
|
sendInput (BROADWAY_EVENT_TOUCH, [0, id, touchId, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onTouchMove(ev) {
|
function onTouchMove(ev) {
|
||||||
event.preventDefault();
|
ev.preventDefault();
|
||||||
|
|
||||||
updateKeyboardStatus();
|
updateKeyboardStatus();
|
||||||
updateForEvent(ev);
|
updateForEvent(ev);
|
||||||
|
|
||||||
for (var i = 0; i < ev.changedTouches.length; i++) {
|
for (var i = 0; i < ev.changedTouches.length; i++) {
|
||||||
var touch = ev.changedTouches.item(i);
|
var touch = ev.changedTouches.item(i);
|
||||||
|
var touchId = touchIdentifier(touch.identifier);
|
||||||
|
|
||||||
var origId = getSurfaceId(touch);
|
var origId = getSurfaceId(touch);
|
||||||
var id = getEffectiveEventTarget (origId);
|
var id = getEffectiveEventTarget (origId);
|
||||||
var pos = getPositionsFromEvent(touch, id);
|
var pos = getPositionsFromEvent(touch, id);
|
||||||
|
|
||||||
var isEmulated = 0;
|
var isEmulated = 0;
|
||||||
if (firstTouchDownId == touch.identifier) {
|
if (firstTouchDownId == touchId) {
|
||||||
isEmulated = 1;
|
isEmulated = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendInput (BROADWAY_EVENT_TOUCH, [1, id, touch.identifier, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
|
sendInput (BROADWAY_EVENT_TOUCH, [1, id, touchId, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onTouchEnd(ev) {
|
function onTouchEnd(ev) {
|
||||||
event.preventDefault();
|
ev.preventDefault();
|
||||||
|
|
||||||
updateKeyboardStatus();
|
updateKeyboardStatus();
|
||||||
updateForEvent(ev);
|
updateForEvent(ev);
|
||||||
|
|
||||||
for (var i = 0; i < ev.changedTouches.length; i++) {
|
for (var i = 0; i < ev.changedTouches.length; i++) {
|
||||||
var touch = ev.changedTouches.item(i);
|
var touch = ev.changedTouches.item(i);
|
||||||
|
var touchId = touchIdentifier(touch.identifier);
|
||||||
|
|
||||||
var origId = getSurfaceId(touch);
|
var origId = getSurfaceId(touch);
|
||||||
var id = getEffectiveEventTarget (origId);
|
var id = getEffectiveEventTarget (origId);
|
||||||
var pos = getPositionsFromEvent(touch, id);
|
var pos = getPositionsFromEvent(touch, id);
|
||||||
|
|
||||||
var isEmulated = 0;
|
var isEmulated = 0;
|
||||||
if (firstTouchDownId == touch.identifier) {
|
if (firstTouchDownId == touchId) {
|
||||||
isEmulated = 1;
|
isEmulated = 1;
|
||||||
firstTouchDownId = null;
|
firstTouchDownId = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendInput (BROADWAY_EVENT_TOUCH, [2, id, touch.identifier, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
|
sendInput (BROADWAY_EVENT_TOUCH, [2, id, touchId, isEmulated, pos.rootX, pos.rootY, pos.winX, pos.winY, lastState]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3167,11 +3280,11 @@ function setupDocument(document)
|
|||||||
document.onkeyup = onKeyUp;
|
document.onkeyup = onKeyUp;
|
||||||
|
|
||||||
if (document.addEventListener) {
|
if (document.addEventListener) {
|
||||||
document.addEventListener('DOMMouseScroll', onMouseWheel, false);
|
document.addEventListener('DOMMouseScroll', onMouseWheel, passiveSupported ? { passive: false, capture: false } : false);
|
||||||
document.addEventListener('mousewheel', onMouseWheel, false);
|
document.addEventListener('mousewheel', onMouseWheel, passiveSupported ? { passive: false, capture: false } : false);
|
||||||
document.addEventListener('touchstart', onTouchStart, false);
|
document.addEventListener('touchstart', onTouchStart, passiveSupported ? { passive: false, capture: false } : false);
|
||||||
document.addEventListener('touchmove', onTouchMove, false);
|
document.addEventListener('touchmove', onTouchMove, passiveSupported ? { passive: false, capture: false } : false);
|
||||||
document.addEventListener('touchend', onTouchEnd, false);
|
document.addEventListener('touchend', onTouchEnd, passiveSupported ? { passive: false, capture: false } : false);
|
||||||
} else if (document.attachEvent) {
|
} else if (document.attachEvent) {
|
||||||
element.attachEvent("onmousewheel", onMouseWheel);
|
element.attachEvent("onmousewheel", onMouseWheel);
|
||||||
}
|
}
|
||||||
@@ -3237,12 +3350,14 @@ function connect()
|
|||||||
};
|
};
|
||||||
|
|
||||||
var iOS = /(iPad|iPhone|iPod)/g.test( navigator.userAgent );
|
var iOS = /(iPad|iPhone|iPod)/g.test( navigator.userAgent );
|
||||||
if (iOS) {
|
if (iOS || isAndroidChrome) {
|
||||||
fakeInput = document.createElement("input");
|
fakeInput = document.createElement("input");
|
||||||
fakeInput.type = "text";
|
fakeInput.type = "text";
|
||||||
fakeInput.style.position = "absolute";
|
fakeInput.style.position = "absolute";
|
||||||
fakeInput.style.left = "-1000px";
|
fakeInput.style.left = "-1000px";
|
||||||
fakeInput.style.top = "-1000px";
|
fakeInput.style.top = "-1000px";
|
||||||
document.body.appendChild(fakeInput);
|
document.body.appendChild(fakeInput);
|
||||||
|
if (isAndroidChrome)
|
||||||
|
fakeInput.addEventListener('input', onInput, passiveSupported ? { passive: false, capture: false } : false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -52,8 +52,7 @@ broadwayjs_h = custom_target('broadwayjs.h',
|
|||||||
)
|
)
|
||||||
|
|
||||||
libgdk_broadway = static_library('gdk-broadway',
|
libgdk_broadway = static_library('gdk-broadway',
|
||||||
clienthtml_h, broadwayjs_h,
|
sources: [ clienthtml_h, broadwayjs_h, gdk_broadway_sources, gdk_gen_headers ],
|
||||||
gdk_broadway_sources, gdkconfig, gdkenum_h,
|
|
||||||
include_directories: [confinc, gdkinc],
|
include_directories: [confinc, gdkinc],
|
||||||
c_args: [
|
c_args: [
|
||||||
'-DGTK_COMPILATION',
|
'-DGTK_COMPILATION',
|
||||||
|
65
gdk/gdk.c
@@ -122,6 +122,7 @@ static const GdkDebugKey gdk_debug_keys[] = {
|
|||||||
|
|
||||||
{ "portals", GDK_DEBUG_PORTALS, "Force use of portals" },
|
{ "portals", GDK_DEBUG_PORTALS, "Force use of portals" },
|
||||||
{ "no-portals", GDK_DEBUG_NO_PORTALS, "Disable use of portals" },
|
{ "no-portals", GDK_DEBUG_NO_PORTALS, "Disable use of portals" },
|
||||||
|
{ "force-offload", GDK_DEBUG_FORCE_OFFLOAD, "Force graphics offload for all textures" },
|
||||||
{ "gl-disable", GDK_DEBUG_GL_DISABLE, "Disable OpenGL support" },
|
{ "gl-disable", GDK_DEBUG_GL_DISABLE, "Disable OpenGL support" },
|
||||||
{ "gl-no-fractional", GDK_DEBUG_GL_NO_FRACTIONAL, "Disable fractional scaling for OpenGL" },
|
{ "gl-no-fractional", GDK_DEBUG_GL_NO_FRACTIONAL, "Disable fractional scaling for OpenGL" },
|
||||||
{ "gl-debug", GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL" },
|
{ "gl-debug", GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL" },
|
||||||
@@ -142,31 +143,50 @@ static const GdkDebugKey gdk_debug_keys[] = {
|
|||||||
|
|
||||||
#ifdef G_HAS_CONSTRUCTORS
|
#ifdef G_HAS_CONSTRUCTORS
|
||||||
#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
|
#ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
|
||||||
#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(stash_desktop_startup_notification_id)
|
#pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(stash_and_unset_environment)
|
||||||
#endif
|
#endif
|
||||||
G_DEFINE_CONSTRUCTOR(stash_desktop_startup_notification_id)
|
G_DEFINE_CONSTRUCTOR(stash_and_unset_environment)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char *startup_notification_id = NULL;
|
static char *startup_notification_id = NULL;
|
||||||
|
static char *xdg_activation_token = NULL;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
stash_desktop_startup_notification_id (void)
|
stash_and_unset_environment (void)
|
||||||
{
|
{
|
||||||
const char *desktop_startup_id;
|
/* Copies environment variables and unsets them so they won't be inherited by
|
||||||
|
|
||||||
desktop_startup_id = g_getenv ("DESKTOP_STARTUP_ID");
|
|
||||||
if (desktop_startup_id && *desktop_startup_id != '\0')
|
|
||||||
{
|
|
||||||
if (!g_utf8_validate (desktop_startup_id, -1, NULL))
|
|
||||||
g_warning ("DESKTOP_STARTUP_ID contains invalid UTF-8");
|
|
||||||
else
|
|
||||||
startup_notification_id = g_strdup (desktop_startup_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Clear the environment variable so it won't be inherited by
|
|
||||||
* child processes and confuse things.
|
* child processes and confuse things.
|
||||||
|
*
|
||||||
|
* Changing environment variables can be racy so we try to do this as early as
|
||||||
|
* possible in the program flow and before any printing that might involve
|
||||||
|
* environment variables.
|
||||||
*/
|
*/
|
||||||
g_unsetenv ("DESKTOP_STARTUP_ID");
|
struct {
|
||||||
|
const char *key;
|
||||||
|
char **dst;
|
||||||
|
} vars[] = {
|
||||||
|
{ "DESKTOP_STARTUP_ID", &startup_notification_id },
|
||||||
|
{ "XDG_ACTIVATION_TOKEN", &xdg_activation_token },
|
||||||
|
};
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
for (i = 0; i < G_N_ELEMENTS (vars); i++)
|
||||||
|
*vars[i].dst = g_strdup (g_getenv (vars[i].key));
|
||||||
|
|
||||||
|
for (i = 0; i < G_N_ELEMENTS (vars); i++)
|
||||||
|
g_unsetenv (vars[i].key);
|
||||||
|
|
||||||
|
for (i = 0; i < G_N_ELEMENTS (vars); i++)
|
||||||
|
{
|
||||||
|
if (*vars[i].dst == NULL)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!g_utf8_validate (*vars[i].dst, -1, NULL))
|
||||||
|
{
|
||||||
|
g_warning ("%s contains invalid UTF-8", vars[i].key);
|
||||||
|
g_clear_pointer (vars[i].dst, g_free);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gpointer
|
static gpointer
|
||||||
@@ -291,7 +311,7 @@ gdk_pre_parse (void)
|
|||||||
gdk_gl_backend_use (GDK_GL_WGL);
|
gdk_gl_backend_use (GDK_GL_WGL);
|
||||||
|
|
||||||
#ifndef G_HAS_CONSTRUCTORS
|
#ifndef G_HAS_CONSTRUCTORS
|
||||||
stash_desktop_startup_notification_id ();
|
stash_and_unset_environment ();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,15 +345,20 @@ gdk_display_open_default (void)
|
|||||||
/*< private >
|
/*< private >
|
||||||
* gdk_get_startup_notification_id:
|
* gdk_get_startup_notification_id:
|
||||||
*
|
*
|
||||||
* Returns the original value of the DESKTOP_STARTUP_ID environment
|
* Returns the original value of the XDG_ACTIVATION_TOKEN environment
|
||||||
* variable if it was defined and valid, or %NULL otherwise.
|
* variable if it was defined and valid, otherwise it returns the original
|
||||||
|
* value of the DESKTOP_STARTUP_ID environment variable if it was defined
|
||||||
|
* and valid, or %NULL if neither of them were defined and valid.
|
||||||
*
|
*
|
||||||
* Returns: (nullable) (transfer none): the original value of the
|
* Returns: (nullable) (transfer none): the original value of the
|
||||||
* DESKTOP_STARTUP_ID environment variable
|
* XDG_ACTIVATION_TOKEN or DESKTOP_STARTUP_ID environment variable
|
||||||
*/
|
*/
|
||||||
const char *
|
const char *
|
||||||
gdk_get_startup_notification_id (void)
|
gdk_get_startup_notification_id (void)
|
||||||
{
|
{
|
||||||
|
if (xdg_activation_token)
|
||||||
|
return xdg_activation_token;
|
||||||
|
|
||||||
return startup_notification_id;
|
return startup_notification_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -156,6 +156,9 @@ gdk_cursor_finalize (GObject *object)
|
|||||||
g_clear_object (&cursor->texture);
|
g_clear_object (&cursor->texture);
|
||||||
g_clear_object (&cursor->fallback);
|
g_clear_object (&cursor->fallback);
|
||||||
|
|
||||||
|
if (cursor->destroy)
|
||||||
|
cursor->destroy (cursor->data);
|
||||||
|
|
||||||
G_OBJECT_CLASS (gdk_cursor_parent_class)->finalize (object);
|
G_OBJECT_CLASS (gdk_cursor_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,6 +256,11 @@ gdk_cursor_hash (gconstpointer pointer)
|
|||||||
hash ^= g_str_hash (cursor->name);
|
hash ^= g_str_hash (cursor->name);
|
||||||
else if (cursor->texture)
|
else if (cursor->texture)
|
||||||
hash ^= g_direct_hash (cursor->texture);
|
hash ^= g_direct_hash (cursor->texture);
|
||||||
|
else if (cursor->callback)
|
||||||
|
{
|
||||||
|
hash ^= g_direct_hash (cursor->callback);
|
||||||
|
hash ^= g_direct_hash (cursor->data);
|
||||||
|
}
|
||||||
|
|
||||||
hash ^= (cursor->hotspot_x << 8) | cursor->hotspot_y;
|
hash ^= (cursor->hotspot_x << 8) | cursor->hotspot_y;
|
||||||
|
|
||||||
@@ -281,6 +289,10 @@ gdk_cursor_equal (gconstpointer a,
|
|||||||
ca->hotspot_y != cb->hotspot_y)
|
ca->hotspot_y != cb->hotspot_y)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
if (ca->callback != cb->callback ||
|
||||||
|
ca->data != cb->data)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,6 +367,45 @@ gdk_cursor_new_from_texture (GdkTexture *texture,
|
|||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gdk_cursor_new_from_callback:
|
||||||
|
* @callback: the `GdkCursorGetTextureCallback`
|
||||||
|
* @data: data to pass to @callback
|
||||||
|
* @destroy: destroy notify for @data
|
||||||
|
* @fallback: (nullable): the `GdkCursor` to fall back to when
|
||||||
|
* this one cannot be supported
|
||||||
|
*
|
||||||
|
* Creates a new callback-based cursor object.
|
||||||
|
*
|
||||||
|
* Cursors of this kind produce textures for the cursor
|
||||||
|
* image on demand, when the @callback is called.
|
||||||
|
*
|
||||||
|
* Returns: (nullable): a new `GdkCursor`
|
||||||
|
*
|
||||||
|
* Since: 4.16
|
||||||
|
*/
|
||||||
|
GdkCursor *
|
||||||
|
gdk_cursor_new_from_callback (GdkCursorGetTextureCallback callback,
|
||||||
|
gpointer data,
|
||||||
|
GDestroyNotify destroy,
|
||||||
|
GdkCursor *fallback)
|
||||||
|
{
|
||||||
|
GdkCursor *cursor;
|
||||||
|
|
||||||
|
g_return_val_if_fail (callback != NULL, NULL);
|
||||||
|
g_return_val_if_fail (fallback == NULL || GDK_IS_CURSOR (fallback), NULL);
|
||||||
|
|
||||||
|
cursor = g_object_new (GDK_TYPE_CURSOR,
|
||||||
|
"fallback", fallback,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
cursor->callback = callback;
|
||||||
|
cursor->data = data;
|
||||||
|
cursor->destroy = destroy;
|
||||||
|
|
||||||
|
return cursor;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gdk_cursor_get_fallback: (attributes org.gtk.Method.get_property=fallback)
|
* gdk_cursor_get_fallback: (attributes org.gtk.Method.get_property=fallback)
|
||||||
* @cursor: a `GdkCursor`
|
* @cursor: a `GdkCursor`
|
||||||
@@ -459,3 +510,22 @@ gdk_cursor_get_hotspot_y (GdkCursor *cursor)
|
|||||||
|
|
||||||
return cursor->hotspot_y;
|
return cursor->hotspot_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GdkTexture *
|
||||||
|
gdk_cursor_get_texture_for_size (GdkCursor *cursor,
|
||||||
|
int cursor_size,
|
||||||
|
double scale,
|
||||||
|
int *width,
|
||||||
|
int *height,
|
||||||
|
int *hotspot_x,
|
||||||
|
int *hotspot_y)
|
||||||
|
{
|
||||||
|
if (cursor->callback == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return cursor->callback (cursor,
|
||||||
|
cursor_size, scale,
|
||||||
|
width, height,
|
||||||
|
hotspot_x, hotspot_y,
|
||||||
|
cursor->data);
|
||||||
|
}
|
||||||
|
@@ -51,6 +51,52 @@ GDK_AVAILABLE_IN_ALL
|
|||||||
GdkCursor* gdk_cursor_new_from_name (const char *name,
|
GdkCursor* gdk_cursor_new_from_name (const char *name,
|
||||||
GdkCursor *fallback);
|
GdkCursor *fallback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GdkCursorGetTestureCallback:
|
||||||
|
* @cursor: the `GdkCursor`
|
||||||
|
* @cursor_size: the nominal cursor size, in application pixels
|
||||||
|
* @scale: the device scale
|
||||||
|
* @width: (out): return location for the actual cursor width,
|
||||||
|
* in application pixels
|
||||||
|
* @height: (out): return location for the actual cursor height,
|
||||||
|
* in application pixels
|
||||||
|
* @hotspot_x: (out): return location for the hotspot X position,
|
||||||
|
* in application pixels
|
||||||
|
* @hotspot_y: (out): return location for the hotspot Y position,
|
||||||
|
* in application pixels
|
||||||
|
* @data: User data for the callback
|
||||||
|
*
|
||||||
|
* The type of callback used by a dynamic `GdkCursor` to generate
|
||||||
|
* a texture for the cursor image at the given @cursor_size
|
||||||
|
* and @scale.
|
||||||
|
*
|
||||||
|
* The actual cursor size in application pixels may be different
|
||||||
|
* from @cursor_size x @cursor_size, and will be returned in
|
||||||
|
* @width, @height. The returned texture should have a size that
|
||||||
|
* corresponds to the actual cursor size, in device pixels (i.e.
|
||||||
|
* application pixels, multiplied by @scale).
|
||||||
|
*
|
||||||
|
* This function may fail and return `NULL`, in which case
|
||||||
|
* the fallback cursor will be used.
|
||||||
|
*
|
||||||
|
* Returns: (nullable) (transfer full): the cursor image, or
|
||||||
|
* `NULL` if none could be produced.
|
||||||
|
*/
|
||||||
|
typedef GdkTexture * (* GdkCursorGetTextureCallback) (GdkCursor *cursor,
|
||||||
|
int cursor_size,
|
||||||
|
double scale,
|
||||||
|
int *width,
|
||||||
|
int *height,
|
||||||
|
int *hotspot_x,
|
||||||
|
int *hotspot_y,
|
||||||
|
gpointer data);
|
||||||
|
|
||||||
|
GDK_AVAILABLE_IN_4_16
|
||||||
|
GdkCursor * gdk_cursor_new_from_callback (GdkCursorGetTextureCallback callback,
|
||||||
|
gpointer data,
|
||||||
|
GDestroyNotify destroy,
|
||||||
|
GdkCursor *fallback);
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
GdkCursor * gdk_cursor_get_fallback (GdkCursor *cursor);
|
GdkCursor * gdk_cursor_get_fallback (GdkCursor *cursor);
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
|
@@ -44,6 +44,10 @@ struct _GdkCursor
|
|||||||
GdkTexture *texture;
|
GdkTexture *texture;
|
||||||
int hotspot_x;
|
int hotspot_x;
|
||||||
int hotspot_y;
|
int hotspot_y;
|
||||||
|
|
||||||
|
GdkCursorGetTextureCallback callback;
|
||||||
|
gpointer data;
|
||||||
|
GDestroyNotify destroy;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GdkCursorClass
|
struct _GdkCursorClass
|
||||||
@@ -55,5 +59,13 @@ guint gdk_cursor_hash (gconstpointer
|
|||||||
gboolean gdk_cursor_equal (gconstpointer a,
|
gboolean gdk_cursor_equal (gconstpointer a,
|
||||||
gconstpointer b);
|
gconstpointer b);
|
||||||
|
|
||||||
|
GdkTexture * gdk_cursor_get_texture_for_size (GdkCursor *cursor,
|
||||||
|
int cursor_size,
|
||||||
|
double scale,
|
||||||
|
int *width,
|
||||||
|
int *height,
|
||||||
|
int *hotspot_x,
|
||||||
|
int *hotspot_y);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@ typedef enum {
|
|||||||
GDK_DEBUG_NO_PORTALS = 1 << 15,
|
GDK_DEBUG_NO_PORTALS = 1 << 15,
|
||||||
GDK_DEBUG_GL_DISABLE = 1 << 16,
|
GDK_DEBUG_GL_DISABLE = 1 << 16,
|
||||||
GDK_DEBUG_GL_NO_FRACTIONAL= 1 << 17,
|
GDK_DEBUG_GL_NO_FRACTIONAL= 1 << 17,
|
||||||
|
GDK_DEBUG_FORCE_OFFLOAD = 1 << 18,
|
||||||
GDK_DEBUG_GL_DISABLE_GL = 1 << 19,
|
GDK_DEBUG_GL_DISABLE_GL = 1 << 19,
|
||||||
GDK_DEBUG_GL_DISABLE_GLES = 1 << 20,
|
GDK_DEBUG_GL_DISABLE_GLES = 1 << 20,
|
||||||
GDK_DEBUG_GL_PREFER_GL = 1 << 21,
|
GDK_DEBUG_GL_PREFER_GL = 1 << 21,
|
||||||
|
@@ -1538,6 +1538,7 @@ describe_egl_config (EGLDisplay egl_display,
|
|||||||
EGLConfig egl_config)
|
EGLConfig egl_config)
|
||||||
{
|
{
|
||||||
EGLint red, green, blue, alpha, type;
|
EGLint red, green, blue, alpha, type;
|
||||||
|
EGLint depth, stencil;
|
||||||
|
|
||||||
if (egl_config == NULL)
|
if (egl_config == NULL)
|
||||||
return g_strdup ("-");
|
return g_strdup ("-");
|
||||||
@@ -1556,7 +1557,16 @@ describe_egl_config (EGLDisplay egl_display,
|
|||||||
else
|
else
|
||||||
type = EGL_COLOR_COMPONENT_TYPE_FIXED_EXT;
|
type = EGL_COLOR_COMPONENT_TYPE_FIXED_EXT;
|
||||||
|
|
||||||
return g_strdup_printf ("R%dG%dB%dA%d%s", red, green, blue, alpha, type == EGL_COLOR_COMPONENT_TYPE_FIXED_EXT ? "" : " float");
|
if (!eglGetConfigAttrib (egl_display, egl_config, EGL_DEPTH_SIZE, &depth))
|
||||||
|
depth = 0;
|
||||||
|
|
||||||
|
if (!eglGetConfigAttrib (egl_display, egl_config, EGL_STENCIL_SIZE, &stencil))
|
||||||
|
stencil = 0;
|
||||||
|
|
||||||
|
return g_strdup_printf ("R%dG%dB%dA%d%s, depth %d, stencil %d", red, green, blue, alpha,
|
||||||
|
type == EGL_COLOR_COMPONENT_TYPE_FIXED_EXT ? "" : " float",
|
||||||
|
depth,
|
||||||
|
stencil);
|
||||||
}
|
}
|
||||||
|
|
||||||
gpointer
|
gpointer
|
||||||
|
@@ -144,8 +144,8 @@ struct _YUVCoefficients
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* multiplied by 65536 */
|
/* multiplied by 65536 */
|
||||||
//static const YUVCoefficients itu601_narrow = { 104597, -25675, -53279, 132201 };
|
static const YUVCoefficients itu601_narrow = { 104597, -25675, -53279, 132201 };
|
||||||
static const YUVCoefficients itu601_wide = { 74711, -25864, -38050, 133176 };
|
//static const YUVCoefficients itu601_wide = { 74711, -25864, -38050, 133176 };
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
get_uv_values (const YUVCoefficients *coeffs,
|
get_uv_values (const YUVCoefficients *coeffs,
|
||||||
@@ -229,7 +229,7 @@ download_nv12 (guchar *dst_data,
|
|||||||
int r, g, b;
|
int r, g, b;
|
||||||
gsize xs, ys;
|
gsize xs, ys;
|
||||||
|
|
||||||
get_uv_values (&itu601_wide, uv_data[x / X_SUB * 2 + U], uv_data[x / X_SUB * 2 + V], &r, &g, &b);
|
get_uv_values (&itu601_narrow, uv_data[x / X_SUB * 2 + U], uv_data[x / X_SUB * 2 + V], &r, &g, &b);
|
||||||
|
|
||||||
for (ys = 0; ys < Y_SUB && y + ys < height; ys++)
|
for (ys = 0; ys < Y_SUB && y + ys < height; ys++)
|
||||||
for (xs = 0; xs < X_SUB && x + xs < width; xs++)
|
for (xs = 0; xs < X_SUB && x + xs < width; xs++)
|
||||||
@@ -309,7 +309,7 @@ download_yuv_3 (guchar *dst_data,
|
|||||||
int r, g, b;
|
int r, g, b;
|
||||||
gsize xs, ys;
|
gsize xs, ys;
|
||||||
|
|
||||||
get_uv_values (&itu601_wide, u_data[x / X_SUB], v_data[x / X_SUB], &r, &g, &b);
|
get_uv_values (&itu601_narrow, u_data[x / X_SUB], v_data[x / X_SUB], &r, &g, &b);
|
||||||
|
|
||||||
for (ys = 0; ys < Y_SUB && y + ys < height; ys++)
|
for (ys = 0; ys < Y_SUB && y + ys < height; ys++)
|
||||||
for (xs = 0; xs < X_SUB && x + xs < width; xs++)
|
for (xs = 0; xs < X_SUB && x + xs < width; xs++)
|
||||||
@@ -365,7 +365,7 @@ download_yuyv (guchar *dst_data,
|
|||||||
{
|
{
|
||||||
int r, g, b;
|
int r, g, b;
|
||||||
|
|
||||||
get_uv_values (&itu601_wide, src_data[2 * x + U], src_data[2 * x + V], &r, &g, &b);
|
get_uv_values (&itu601_narrow, src_data[2 * x + U], src_data[2 * x + V], &r, &g, &b);
|
||||||
set_rgb_values (&dst_data[3 * x], src_data[2 * x + Y1], r, g, b);
|
set_rgb_values (&dst_data[3 * x], src_data[2 * x + Y1], r, g, b);
|
||||||
if (x + 1 < width)
|
if (x + 1 < width)
|
||||||
set_rgb_values (&dst_data[3 * (x + 1)], src_data[2 * x + Y2], r, g, b);
|
set_rgb_values (&dst_data[3 * (x + 1)], src_data[2 * x + Y2], r, g, b);
|
||||||
|
@@ -163,6 +163,8 @@ gdk_dmabuf_get_egl_downloader (GdkDisplay *display,
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
previous = gdk_gl_context_get_current ();
|
previous = gdk_gl_context_get_current ();
|
||||||
|
if (previous)
|
||||||
|
g_object_ref (previous);
|
||||||
formats = gdk_dmabuf_formats_builder_new ();
|
formats = gdk_dmabuf_formats_builder_new ();
|
||||||
external = gdk_dmabuf_formats_builder_new ();
|
external = gdk_dmabuf_formats_builder_new ();
|
||||||
|
|
||||||
@@ -194,7 +196,10 @@ gdk_dmabuf_get_egl_downloader (GdkDisplay *display,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (previous)
|
if (previous)
|
||||||
gdk_gl_context_make_current (previous);
|
{
|
||||||
|
gdk_gl_context_make_current (previous);
|
||||||
|
g_object_unref (previous);
|
||||||
|
}
|
||||||
|
|
||||||
return GDK_DMABUF_DOWNLOADER (renderer);
|
return GDK_DMABUF_DOWNLOADER (renderer);
|
||||||
}
|
}
|
||||||
@@ -239,7 +244,7 @@ gdk_dmabuf_egl_create_image (GdkDisplay *display,
|
|||||||
attribs[i++] = EGL_YUV_COLOR_SPACE_HINT_EXT;
|
attribs[i++] = EGL_YUV_COLOR_SPACE_HINT_EXT;
|
||||||
attribs[i++] = EGL_ITU_REC601_EXT;
|
attribs[i++] = EGL_ITU_REC601_EXT;
|
||||||
attribs[i++] = EGL_SAMPLE_RANGE_HINT_EXT;
|
attribs[i++] = EGL_SAMPLE_RANGE_HINT_EXT;
|
||||||
attribs[i++] = EGL_YUV_FULL_RANGE_EXT;
|
attribs[i++] = EGL_YUV_NARROW_RANGE_EXT;
|
||||||
|
|
||||||
#define ADD_PLANE(plane) \
|
#define ADD_PLANE(plane) \
|
||||||
{ \
|
{ \
|
||||||
@@ -265,6 +270,7 @@ gdk_dmabuf_egl_create_image (GdkDisplay *display,
|
|||||||
if (dmabuf->n_planes > 3) ADD_PLANE (3);
|
if (dmabuf->n_planes > 3) ADD_PLANE (3);
|
||||||
|
|
||||||
attribs[i++] = EGL_NONE;
|
attribs[i++] = EGL_NONE;
|
||||||
|
g_assert (i < G_N_ELEMENTS (attribs));
|
||||||
|
|
||||||
image = eglCreateImageKHR (egl_display,
|
image = eglCreateImageKHR (egl_display,
|
||||||
EGL_NO_CONTEXT,
|
EGL_NO_CONTEXT,
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
#include "gdkdmabufformatsbuilderprivate.h"
|
#include "gdkdmabufformatsbuilderprivate.h"
|
||||||
#include "gdkdmabuffourccprivate.h"
|
#include "gdkdmabuffourccprivate.h"
|
||||||
#include "gdkdmabufprivate.h"
|
#include "gdkdmabufprivate.h"
|
||||||
|
#include "gdkdmabuftexturebuilderprivate.h"
|
||||||
#include "gdktextureprivate.h"
|
#include "gdktextureprivate.h"
|
||||||
#include <gdk/gdkglcontext.h>
|
#include <gdk/gdkglcontext.h>
|
||||||
#include <gdk/gdkgltexturebuilder.h>
|
#include <gdk/gdkgltexturebuilder.h>
|
||||||
@@ -71,7 +72,10 @@ gdk_dmabuf_texture_dispose (GObject *object)
|
|||||||
GdkDmabufTexture *self = GDK_DMABUF_TEXTURE (object);
|
GdkDmabufTexture *self = GDK_DMABUF_TEXTURE (object);
|
||||||
|
|
||||||
if (self->destroy)
|
if (self->destroy)
|
||||||
self->destroy (self->data);
|
{
|
||||||
|
self->destroy (self->data);
|
||||||
|
self->destroy = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
g_clear_object (&self->downloader);
|
g_clear_object (&self->downloader);
|
||||||
g_clear_object (&self->display);
|
g_clear_object (&self->display);
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
#include "gdkdisplay.h"
|
#include "gdkdisplay.h"
|
||||||
#include "gdkenumtypes.h"
|
#include "gdkenumtypes.h"
|
||||||
#include "gdkdmabuftextureprivate.h"
|
#include "gdkdmabuftextureprivate.h"
|
||||||
|
#include "gdkdmabuftexturebuilderprivate.h"
|
||||||
|
|
||||||
#include <cairo-gobject.h>
|
#include <cairo-gobject.h>
|
||||||
|
|
||||||
@@ -948,22 +949,20 @@ gdk_dmabuf_texture_builder_set_update_region (GdkDmabufTextureBuilder *self,
|
|||||||
*
|
*
|
||||||
* Builds a new `GdkTexture` with the values set up in the builder.
|
* Builds a new `GdkTexture` with the values set up in the builder.
|
||||||
*
|
*
|
||||||
* It is a programming error to call this function if any mandatory
|
* It is a programming error to call this function if any mandatory property has not been set.
|
||||||
* property has not been set.
|
|
||||||
*
|
*
|
||||||
* If the dmabuf is not supported by GTK, %NULL will be returned and @error will be set.
|
* Not all formats defined in the `drm_fourcc.h` header are supported. You can use
|
||||||
|
* [method@Gdk.Display.get_dmabuf_formats] to get a list of supported formats. If the
|
||||||
|
* format is not supported by GTK, %NULL will be returned and @error will be set.
|
||||||
*
|
*
|
||||||
* The `destroy` function gets called when the returned texture gets released.
|
* The `destroy` function gets called when the returned texture gets released.
|
||||||
*
|
*
|
||||||
* It is possible to call this function multiple times to create multiple textures,
|
|
||||||
* possibly with changing properties in between.
|
|
||||||
*
|
|
||||||
* It is the responsibility of the caller to keep the file descriptors for the planes
|
* It is the responsibility of the caller to keep the file descriptors for the planes
|
||||||
* open until the created texture is no longer used, and close them afterwards (possibly
|
* open until the created texture is no longer used, and close them afterwards (possibly
|
||||||
* using the @destroy notify).
|
* using the @destroy notify).
|
||||||
*
|
*
|
||||||
* Not all formats defined in the `drm_fourcc.h` header are supported. You can use
|
* It is possible to call this function multiple times to create multiple textures,
|
||||||
* [method@Gdk.Display.get_dmabuf_formats] to get a list of supported formats.
|
* possibly with changing properties in between.
|
||||||
*
|
*
|
||||||
* Returns: (transfer full) (nullable): a newly built `GdkTexture` or `NULL`
|
* Returns: (transfer full) (nullable): a newly built `GdkTexture` or `NULL`
|
||||||
* if the format is not supported
|
* if the format is not supported
|
||||||
@@ -1004,3 +1003,19 @@ gdk_dmabuf_texture_builder_get_dmabuf (GdkDmabufTextureBuilder *self)
|
|||||||
{
|
{
|
||||||
return &self->dmabuf;
|
return &self->dmabuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gdk_dmabuf_texture_builder_set_dmabuf (GdkDmabufTextureBuilder *self,
|
||||||
|
const GdkDmabuf *dmabuf)
|
||||||
|
{
|
||||||
|
gdk_dmabuf_texture_builder_set_fourcc (self, dmabuf->fourcc);
|
||||||
|
gdk_dmabuf_texture_builder_set_modifier (self, dmabuf->modifier);
|
||||||
|
gdk_dmabuf_texture_builder_set_n_planes (self, dmabuf->n_planes);
|
||||||
|
|
||||||
|
for (unsigned int i = 0; i < dmabuf->n_planes; i++)
|
||||||
|
{
|
||||||
|
gdk_dmabuf_texture_builder_set_fd (self, i, dmabuf->planes[i].fd);
|
||||||
|
gdk_dmabuf_texture_builder_set_stride (self, i, dmabuf->planes[i].stride);
|
||||||
|
gdk_dmabuf_texture_builder_set_offset (self, i, dmabuf->planes[i].offset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
14
gdk/gdkdmabuftexturebuilderprivate.h
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "gdkdmabuftexturebuilder.h"
|
||||||
|
#include "gdkdmabufprivate.h"
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
const GdkDmabuf * gdk_dmabuf_texture_builder_get_dmabuf (GdkDmabufTextureBuilder *builder);
|
||||||
|
|
||||||
|
void gdk_dmabuf_texture_builder_set_dmabuf (GdkDmabufTextureBuilder *builder,
|
||||||
|
const GdkDmabuf *dmabuf);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
@@ -7,8 +7,6 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
const GdkDmabuf * gdk_dmabuf_texture_builder_get_dmabuf (GdkDmabufTextureBuilder *builder);
|
|
||||||
|
|
||||||
GdkTexture * gdk_dmabuf_texture_new_from_builder (GdkDmabufTextureBuilder *builder,
|
GdkTexture * gdk_dmabuf_texture_new_from_builder (GdkDmabufTextureBuilder *builder,
|
||||||
GDestroyNotify destroy,
|
GDestroyNotify destroy,
|
||||||
gpointer data,
|
gpointer data,
|
||||||
|
@@ -50,18 +50,6 @@
|
|||||||
#include "gdkenumtypes.h"
|
#include "gdkenumtypes.h"
|
||||||
#include "gdkeventsprivate.h"
|
#include "gdkeventsprivate.h"
|
||||||
|
|
||||||
static struct {
|
|
||||||
GdkDragAction action;
|
|
||||||
const char *name;
|
|
||||||
GdkCursor *cursor;
|
|
||||||
} drag_cursors[] = {
|
|
||||||
{ GDK_ACTION_ASK, "dnd-ask", NULL },
|
|
||||||
{ GDK_ACTION_COPY, "copy", NULL },
|
|
||||||
{ GDK_ACTION_MOVE, "move", NULL },
|
|
||||||
{ GDK_ACTION_LINK, "alias", NULL },
|
|
||||||
{ 0, "no-drop", NULL },
|
|
||||||
};
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_CONTENT,
|
PROP_CONTENT,
|
||||||
@@ -786,6 +774,20 @@ gdk_drag_handle_source_event (GdkEvent *event)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct {
|
||||||
|
GdkDragAction action;
|
||||||
|
const char *name;
|
||||||
|
GdkCursor *cursor;
|
||||||
|
} drag_cursors[] = {
|
||||||
|
{ 0, "default", NULL },
|
||||||
|
{ GDK_ACTION_ASK, "dnd-ask", NULL },
|
||||||
|
{ GDK_ACTION_COPY, "copy", NULL },
|
||||||
|
{ GDK_ACTION_MOVE, "dnd-move", NULL }, /* Not using move here, since move is stuck using
|
||||||
|
* a mismatched visual metaphor in Adwaita
|
||||||
|
*/
|
||||||
|
{ GDK_ACTION_LINK, "alias", NULL },
|
||||||
|
};
|
||||||
|
|
||||||
GdkCursor *
|
GdkCursor *
|
||||||
gdk_drag_get_cursor (GdkDrag *drag,
|
gdk_drag_get_cursor (GdkDrag *drag,
|
||||||
GdkDragAction action)
|
GdkDragAction action)
|
||||||
|
@@ -192,13 +192,6 @@ compute_smooth_frame_time (GdkFrameClock *clock,
|
|||||||
* and new_frame_time >= old_frame_time. */
|
* and new_frame_time >= old_frame_time. */
|
||||||
frames_passed = (new_frame_time - smoothed_frame_time_base + frame_interval / 2) / frame_interval;
|
frames_passed = (new_frame_time - smoothed_frame_time_base + frame_interval / 2) / frame_interval;
|
||||||
|
|
||||||
if (frames_passed > 1)
|
|
||||||
gdk_profiler_add_markf ((smoothed_frame_time_base - (frame_interval * (frames_passed-1))) * 1000L,
|
|
||||||
frame_interval * (frames_passed-1) * 1000L,
|
|
||||||
"Dropped Frames",
|
|
||||||
"%u frames may have been dropped",
|
|
||||||
frames_passed-1);
|
|
||||||
|
|
||||||
/* We use an approximately whole number of frames in the future from
|
/* We use an approximately whole number of frames in the future from
|
||||||
* last smoothed frame time. This way we avoid minor jitter in the
|
* last smoothed frame time. This way we avoid minor jitter in the
|
||||||
* frame times making the animation speed uneven, but still animate
|
* frame times making the animation speed uneven, but still animate
|
||||||
|
@@ -125,7 +125,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
|
|||||||
* the GL_UNPACK_ROW_LENGTH support
|
* the GL_UNPACK_ROW_LENGTH support
|
||||||
*/
|
*/
|
||||||
if (gdk_gl_context_get_use_es (paint_context) &&
|
if (gdk_gl_context_get_use_es (paint_context) &&
|
||||||
!(version >= 300 || gdk_gl_context_has_unpack_subimage (paint_context)))
|
!(version >= 300 || gdk_gl_context_has_feature (paint_context, GDK_GL_FEATURE_UNPACK_SUBIMAGE)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* TODO: avoid reading back non-required data due to dest clip */
|
/* TODO: avoid reading back non-required data due to dest clip */
|
||||||
|
@@ -103,6 +103,15 @@
|
|||||||
|
|
||||||
#define DEFAULT_ALLOWED_APIS GDK_GL_API_GL | GDK_GL_API_GLES
|
#define DEFAULT_ALLOWED_APIS GDK_GL_API_GL | GDK_GL_API_GLES
|
||||||
|
|
||||||
|
static const GdkDebugKey gdk_gl_feature_keys[] = {
|
||||||
|
{ "debug", GDK_GL_FEATURE_DEBUG, "GL_KHR_debug" },
|
||||||
|
{ "unpack-subimage", GDK_GL_FEATURE_UNPACK_SUBIMAGE, "GL_EXT_unpack_subimage" },
|
||||||
|
{ "half-float", GDK_GL_FEATURE_VERTEX_HALF_FLOAT, "GL_OES_vertex_half_float" },
|
||||||
|
{ "sync", GDK_GL_FEATURE_SYNC, "GL_ARB_sync" },
|
||||||
|
{ "base-instance", GDK_GL_FEATURE_BASE_INSTANCE, "GL_ARB_base_instance" },
|
||||||
|
{ "buffer-storage", GDK_GL_FEATURE_BUFFER_STORAGE, "GL_EXT_buffer_storage" },
|
||||||
|
};
|
||||||
|
|
||||||
typedef struct _GdkGLContextPrivate GdkGLContextPrivate;
|
typedef struct _GdkGLContextPrivate GdkGLContextPrivate;
|
||||||
|
|
||||||
struct _GdkGLContextPrivate
|
struct _GdkGLContextPrivate
|
||||||
@@ -112,13 +121,9 @@ struct _GdkGLContextPrivate
|
|||||||
|
|
||||||
GdkGLMemoryFlags memory_flags[GDK_MEMORY_N_FORMATS];
|
GdkGLMemoryFlags memory_flags[GDK_MEMORY_N_FORMATS];
|
||||||
|
|
||||||
guint has_khr_debug : 1;
|
GdkGLFeatures features;
|
||||||
guint use_khr_debug : 1;
|
guint use_khr_debug : 1;
|
||||||
guint has_half_float : 1;
|
|
||||||
guint has_sync : 1;
|
|
||||||
guint has_unpack_subimage : 1;
|
|
||||||
guint has_debug_output : 1;
|
guint has_debug_output : 1;
|
||||||
guint has_bgra : 1;
|
|
||||||
guint extensions_checked : 1;
|
guint extensions_checked : 1;
|
||||||
guint debug_enabled : 1;
|
guint debug_enabled : 1;
|
||||||
guint forward_compatible : 1;
|
guint forward_compatible : 1;
|
||||||
@@ -290,7 +295,7 @@ gdk_gl_context_create_egl_context (GdkGLContext *context,
|
|||||||
GdkDisplay *display = gdk_gl_context_get_display (context);
|
GdkDisplay *display = gdk_gl_context_get_display (context);
|
||||||
EGLDisplay egl_display = gdk_display_get_egl_display (display);
|
EGLDisplay egl_display = gdk_display_get_egl_display (display);
|
||||||
GdkGLContext *share = gdk_display_get_gl_context (display);
|
GdkGLContext *share = gdk_display_get_gl_context (display);
|
||||||
GdkGLContextPrivate *share_priv = gdk_gl_context_get_instance_private (share);
|
GdkGLContextPrivate *share_priv = share ? gdk_gl_context_get_instance_private (share) : NULL;
|
||||||
EGLConfig egl_config;
|
EGLConfig egl_config;
|
||||||
EGLContext ctx;
|
EGLContext ctx;
|
||||||
EGLint context_attribs[N_EGL_ATTRS], i = 0, flags = 0;
|
EGLint context_attribs[N_EGL_ATTRS], i = 0, flags = 0;
|
||||||
@@ -898,11 +903,12 @@ gdk_gl_context_label_object_printf (GdkGLContext *context,
|
|||||||
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gdk_gl_context_has_unpack_subimage (GdkGLContext *context)
|
gdk_gl_context_has_feature (GdkGLContext *self,
|
||||||
|
GdkGLFeatures feature)
|
||||||
{
|
{
|
||||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (self);
|
||||||
|
|
||||||
return priv->has_unpack_subimage;
|
return (priv->features & feature) == feature;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -1664,10 +1670,53 @@ gdk_gl_version_init_epoxy (GdkGLVersion *version)
|
|||||||
*version = GDK_GL_VERSION_INIT (epoxy_version / 10, epoxy_version % 10);
|
*version = GDK_GL_VERSION_INIT (epoxy_version / 10, epoxy_version % 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GdkGLFeatures
|
||||||
|
gdk_gl_context_check_features (GdkGLContext *context)
|
||||||
|
{
|
||||||
|
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||||
|
GdkGLFeatures features = 0;
|
||||||
|
|
||||||
|
if (gdk_gl_context_get_use_es (context))
|
||||||
|
{
|
||||||
|
if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 0)) ||
|
||||||
|
epoxy_has_gl_extension ("GL_EXT_unpack_subimage"))
|
||||||
|
features |= GDK_GL_FEATURE_UNPACK_SUBIMAGE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
features |= GDK_GL_FEATURE_UNPACK_SUBIMAGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (epoxy_has_gl_extension ("GL_KHR_debug"))
|
||||||
|
features |= GDK_GL_FEATURE_DEBUG;
|
||||||
|
|
||||||
|
if (gdk_gl_context_check_version (context, "3.0", "3.0") ||
|
||||||
|
epoxy_has_gl_extension ("GL_OES_vertex_half_float"))
|
||||||
|
features |= GDK_GL_FEATURE_VERTEX_HALF_FLOAT;
|
||||||
|
|
||||||
|
if (gdk_gl_context_check_version (context, "3.2", "3.0") ||
|
||||||
|
epoxy_has_gl_extension ("GL_ARB_sync") ||
|
||||||
|
epoxy_has_gl_extension ("GL_APPLE_sync"))
|
||||||
|
features |= GDK_GL_FEATURE_SYNC;
|
||||||
|
|
||||||
|
if (gdk_gl_context_check_version (context, "4.2", "9.9") ||
|
||||||
|
epoxy_has_gl_extension ("GL_EXT_base_instance") ||
|
||||||
|
epoxy_has_gl_extension ("GL_ARB_base_instance"))
|
||||||
|
features |= GDK_GL_FEATURE_BASE_INSTANCE;
|
||||||
|
|
||||||
|
if (gdk_gl_context_check_version (context, "4.4", "9.9") ||
|
||||||
|
epoxy_has_gl_extension ("GL_EXT_buffer_storage") ||
|
||||||
|
epoxy_has_gl_extension ("GL_ARB_buffer_storage"))
|
||||||
|
features |= GDK_GL_FEATURE_BUFFER_STORAGE;
|
||||||
|
|
||||||
|
return features;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gdk_gl_context_check_extensions (GdkGLContext *context)
|
gdk_gl_context_check_extensions (GdkGLContext *context)
|
||||||
{
|
{
|
||||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||||
|
GdkGLFeatures supported_features, disabled_features;
|
||||||
gboolean gl_debug = FALSE;
|
gboolean gl_debug = FALSE;
|
||||||
GdkDisplay *display;
|
GdkDisplay *display;
|
||||||
|
|
||||||
@@ -1685,69 +1734,54 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
|
|||||||
|
|
||||||
if (priv->has_debug_output && gl_debug)
|
if (priv->has_debug_output && gl_debug)
|
||||||
{
|
{
|
||||||
gdk_gl_context_make_current (context);
|
|
||||||
glEnable (GL_DEBUG_OUTPUT);
|
glEnable (GL_DEBUG_OUTPUT);
|
||||||
glEnable (GL_DEBUG_OUTPUT_SYNCHRONOUS);
|
glEnable (GL_DEBUG_OUTPUT_SYNCHRONOUS);
|
||||||
glDebugMessageCallback (gl_debug_message_callback, NULL);
|
glDebugMessageCallback (gl_debug_message_callback, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gdk_gl_context_get_use_es (context))
|
/* If we asked for a core profile, but didn't get one, we're in legacy mode */
|
||||||
{
|
if (!gdk_gl_context_get_use_es (context) &&
|
||||||
priv->has_unpack_subimage = gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 0)) ||
|
!gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 2)))
|
||||||
epoxy_has_gl_extension ("GL_EXT_unpack_subimage");
|
priv->is_legacy = TRUE;
|
||||||
priv->has_khr_debug = epoxy_has_gl_extension ("GL_KHR_debug");
|
|
||||||
priv->has_bgra = epoxy_has_gl_extension ("GL_EXT_texture_format_BGRA8888");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
priv->has_unpack_subimage = TRUE;
|
|
||||||
priv->has_khr_debug = epoxy_has_gl_extension ("GL_KHR_debug");
|
|
||||||
priv->has_bgra = TRUE;
|
|
||||||
|
|
||||||
/* We asked for a core profile, but we didn't get one, so we're in legacy mode */
|
supported_features = gdk_gl_context_check_features (context);
|
||||||
if (!gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 2)))
|
disabled_features = gdk_parse_debug_var ("GDK_GL_DISABLE",
|
||||||
priv->is_legacy = TRUE;
|
gdk_gl_feature_keys,
|
||||||
}
|
G_N_ELEMENTS (gdk_gl_feature_keys));
|
||||||
|
|
||||||
if (priv->has_khr_debug && gl_debug)
|
priv->features = supported_features & ~disabled_features;
|
||||||
|
|
||||||
|
gdk_gl_context_init_memory_flags (context);
|
||||||
|
|
||||||
|
if ((priv->features & GDK_GL_FEATURE_DEBUG) && gl_debug)
|
||||||
{
|
{
|
||||||
priv->use_khr_debug = TRUE;
|
priv->use_khr_debug = TRUE;
|
||||||
glGetIntegerv (GL_MAX_LABEL_LENGTH, &priv->max_debug_label_length);
|
glGetIntegerv (GL_MAX_LABEL_LENGTH, &priv->max_debug_label_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->has_half_float = gdk_gl_context_check_version (context, "3.0", "3.0") ||
|
if (GDK_DISPLAY_DEBUG_CHECK (display, OPENGL))
|
||||||
epoxy_has_gl_extension ("GL_OES_vertex_half_float");
|
{
|
||||||
|
int i, max_texture_size;
|
||||||
priv->has_sync = gdk_gl_context_check_version (context, "3.2", "3.0") ||
|
glGetIntegerv (GL_MAX_TEXTURE_SIZE, &max_texture_size);
|
||||||
epoxy_has_gl_extension ("GL_ARB_sync") ||
|
gdk_debug_message ("%s version: %d.%d (%s)\n"
|
||||||
epoxy_has_gl_extension ("GL_APPLE_sync");
|
"* GLSL version: %s\n"
|
||||||
|
"* Max texture size: %d\n",
|
||||||
gdk_gl_context_init_memory_flags (context);
|
gdk_gl_context_get_use_es (context) ? "OpenGL ES" : "OpenGL",
|
||||||
|
gdk_gl_version_get_major (&priv->gl_version), gdk_gl_version_get_minor (&priv->gl_version),
|
||||||
{
|
priv->is_legacy ? "legacy" : "core",
|
||||||
int max_texture_size;
|
glGetString (GL_SHADING_LANGUAGE_VERSION),
|
||||||
glGetIntegerv (GL_MAX_TEXTURE_SIZE, &max_texture_size);
|
max_texture_size);
|
||||||
GDK_DISPLAY_DEBUG (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), OPENGL,
|
gdk_debug_message ("Enabled features (use GDK_GL_DISABLE env var to disable):");
|
||||||
"%s version: %d.%d (%s)\n"
|
for (i = 0; i < G_N_ELEMENTS (gdk_gl_feature_keys); i++)
|
||||||
"* GLSL version: %s\n"
|
{
|
||||||
"* Max texture size: %d\n"
|
gdk_debug_message (" %s: %s",
|
||||||
"* Extensions checked:\n"
|
gdk_gl_feature_keys[i].key,
|
||||||
" - GL_KHR_debug: %s\n"
|
(priv->features & gdk_gl_feature_keys[i].value) ? "YES" :
|
||||||
" - GL_EXT_unpack_subimage: %s\n"
|
((disabled_features & gdk_gl_feature_keys[i].value) ? "disabled via env var" :
|
||||||
" - half float: %s\n"
|
(((supported_features & gdk_gl_feature_keys[i].value) == 0) ? "not supported" :
|
||||||
" - sync: %s\n"
|
"Hum, what? This should not happen.")));
|
||||||
" - bgra: %s",
|
}
|
||||||
gdk_gl_context_get_use_es (context) ? "OpenGL ES" : "OpenGL",
|
}
|
||||||
gdk_gl_version_get_major (&priv->gl_version), gdk_gl_version_get_minor (&priv->gl_version),
|
|
||||||
priv->is_legacy ? "legacy" : "core",
|
|
||||||
glGetString (GL_SHADING_LANGUAGE_VERSION),
|
|
||||||
max_texture_size,
|
|
||||||
priv->has_khr_debug ? "yes" : "no",
|
|
||||||
priv->has_unpack_subimage ? "yes" : "no",
|
|
||||||
priv->has_half_float ? "yes" : "no",
|
|
||||||
priv->has_sync ? "yes" : "no",
|
|
||||||
priv->has_bgra ? "yes" : "no");
|
|
||||||
}
|
|
||||||
|
|
||||||
priv->extensions_checked = TRUE;
|
priv->extensions_checked = TRUE;
|
||||||
}
|
}
|
||||||
@@ -1922,8 +1956,6 @@ gdk_gl_context_get_glsl_version_string (GdkGLContext *self)
|
|||||||
return "#version 310 es";
|
return "#version 310 es";
|
||||||
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 0)))
|
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 0)))
|
||||||
return "#version 300 es";
|
return "#version 300 es";
|
||||||
else if (gdk_gl_version_greater_equal (&priv->gl_version, &GDK_GL_VERSION_INIT (3, 0)))
|
|
||||||
return "#version 300 es";
|
|
||||||
else
|
else
|
||||||
return "#version 100";
|
return "#version 100";
|
||||||
}
|
}
|
||||||
@@ -2016,30 +2048,6 @@ gdk_gl_context_get_format_flags (GdkGLContext *self,
|
|||||||
return priv->memory_flags[format];
|
return priv->memory_flags[format];
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
|
||||||
gdk_gl_context_has_debug (GdkGLContext *self)
|
|
||||||
{
|
|
||||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (self);
|
|
||||||
|
|
||||||
return priv->debug_enabled || priv->use_khr_debug;
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
|
||||||
gdk_gl_context_has_vertex_half_float (GdkGLContext *self)
|
|
||||||
{
|
|
||||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (self);
|
|
||||||
|
|
||||||
return priv->has_half_float;
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
|
||||||
gdk_gl_context_has_sync (GdkGLContext *self)
|
|
||||||
{
|
|
||||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (self);
|
|
||||||
|
|
||||||
return priv->has_sync;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return if glGenVertexArrays, glBindVertexArray and glDeleteVertexArrays
|
/* Return if glGenVertexArrays, glBindVertexArray and glDeleteVertexArrays
|
||||||
* can be used
|
* can be used
|
||||||
*/
|
*/
|
||||||
@@ -2188,12 +2196,78 @@ gdk_gl_context_import_dmabuf (GdkGLContext *self,
|
|||||||
|
|
||||||
gdk_display_init_dmabuf (display);
|
gdk_display_init_dmabuf (display);
|
||||||
|
|
||||||
if (!gdk_dmabuf_formats_contains (display->egl_external_formats, dmabuf->fourcc, dmabuf->modifier))
|
if (gdk_dmabuf_formats_contains (display->egl_dmabuf_formats, dmabuf->fourcc, dmabuf->modifier))
|
||||||
{
|
{
|
||||||
|
/* This is the path for modern drivers that support modifiers */
|
||||||
|
|
||||||
|
if (!gdk_dmabuf_formats_contains (display->egl_external_formats, dmabuf->fourcc, dmabuf->modifier))
|
||||||
|
{
|
||||||
|
texture_id = gdk_gl_context_import_dmabuf_for_target (self,
|
||||||
|
width, height,
|
||||||
|
dmabuf,
|
||||||
|
GL_TEXTURE_2D);
|
||||||
|
if (texture_id == 0)
|
||||||
|
{
|
||||||
|
GDK_DISPLAY_DEBUG (display, DMABUF,
|
||||||
|
"Import of %dx%d %.4s:%#" G_GINT64_MODIFIER "x dmabuf failed",
|
||||||
|
width, height,
|
||||||
|
(char *) &dmabuf->fourcc, dmabuf->modifier);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
GDK_DISPLAY_DEBUG (display, DMABUF,
|
||||||
|
"Imported %dx%d %.4s:%#" G_GINT64_MODIFIER "x dmabuf as GL_TEXTURE_2D texture",
|
||||||
|
width, height,
|
||||||
|
(char *) &dmabuf->fourcc, dmabuf->modifier);
|
||||||
|
*external = FALSE;
|
||||||
|
return texture_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!gdk_gl_context_get_use_es (self))
|
||||||
|
{
|
||||||
|
GDK_DISPLAY_DEBUG (display, DMABUF,
|
||||||
|
"Can't import external_only %.4s:%#" G_GINT64_MODIFIER "x outside of GLES",
|
||||||
|
(char *) &dmabuf->fourcc, dmabuf->modifier);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
texture_id = gdk_gl_context_import_dmabuf_for_target (self,
|
texture_id = gdk_gl_context_import_dmabuf_for_target (self,
|
||||||
width, height,
|
width, height,
|
||||||
dmabuf,
|
dmabuf,
|
||||||
GL_TEXTURE_2D);
|
GL_TEXTURE_EXTERNAL_OES);
|
||||||
|
if (texture_id == 0)
|
||||||
|
{
|
||||||
|
GDK_DISPLAY_DEBUG (display, DMABUF,
|
||||||
|
"Import of external_only %dx%d %.4s:%#" G_GINT64_MODIFIER "x dmabuf failed",
|
||||||
|
width, height,
|
||||||
|
(char *) &dmabuf->fourcc, dmabuf->modifier);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
GDK_DISPLAY_DEBUG (display, DMABUF,
|
||||||
|
"Imported %dx%d %.4s:%#" G_GINT64_MODIFIER "x dmabuf as GL_TEXTURE_EXTERNAL_OES texture",
|
||||||
|
width, height,
|
||||||
|
(char *) &dmabuf->fourcc, dmabuf->modifier);
|
||||||
|
*external = TRUE;
|
||||||
|
return texture_id;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* This is the opportunistic path.
|
||||||
|
* We hit it both for drivers that do not support modifiers as well as for dmabufs
|
||||||
|
* that the driver did not explicitly advertise. */
|
||||||
|
int target;
|
||||||
|
|
||||||
|
if (gdk_gl_context_get_use_es (self))
|
||||||
|
target = GL_TEXTURE_EXTERNAL_OES;
|
||||||
|
else
|
||||||
|
target = GL_TEXTURE_2D;
|
||||||
|
|
||||||
|
texture_id = gdk_gl_context_import_dmabuf_for_target (self,
|
||||||
|
width, height,
|
||||||
|
dmabuf,
|
||||||
|
target);
|
||||||
|
|
||||||
if (texture_id == 0)
|
if (texture_id == 0)
|
||||||
{
|
{
|
||||||
GDK_DISPLAY_DEBUG (display, DMABUF,
|
GDK_DISPLAY_DEBUG (display, DMABUF,
|
||||||
@@ -2204,40 +2278,13 @@ gdk_gl_context_import_dmabuf (GdkGLContext *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
GDK_DISPLAY_DEBUG (display, DMABUF,
|
GDK_DISPLAY_DEBUG (display, DMABUF,
|
||||||
"Imported %dx%d %.4s:%#" G_GINT64_MODIFIER "x dmabuf as GL_TEXTURE_2D texture",
|
"Imported %dx%d %.4s:%#" G_GINT64_MODIFIER "x dmabuf as %s texture",
|
||||||
width, height,
|
width, height,
|
||||||
(char *) &dmabuf->fourcc, dmabuf->modifier);
|
(char *) &dmabuf->fourcc, dmabuf->modifier,
|
||||||
*external = FALSE;
|
target == GL_TEXTURE_EXTERNAL_OES ? "GL_TEXTURE_EXTERNAL_OES" : "GL_TEXTURE_2D");
|
||||||
|
*external = target == GL_TEXTURE_EXTERNAL_OES;
|
||||||
return texture_id;
|
return texture_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gdk_gl_context_get_use_es (self))
|
|
||||||
{
|
|
||||||
GDK_DISPLAY_DEBUG (display, DMABUF,
|
|
||||||
"Can't import external_only %.4s:%#" G_GINT64_MODIFIER "x outside of GLES",
|
|
||||||
(char *) &dmabuf->fourcc, dmabuf->modifier);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
texture_id = gdk_gl_context_import_dmabuf_for_target (self,
|
|
||||||
width, height,
|
|
||||||
dmabuf,
|
|
||||||
GL_TEXTURE_EXTERNAL_OES);
|
|
||||||
if (texture_id == 0)
|
|
||||||
{
|
|
||||||
GDK_DISPLAY_DEBUG (display, DMABUF,
|
|
||||||
"Import of external_only %dx%d %.4s:%#" G_GINT64_MODIFIER "x dmabuf failed",
|
|
||||||
width, height,
|
|
||||||
(char *) &dmabuf->fourcc, dmabuf->modifier);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
GDK_DISPLAY_DEBUG (display, DMABUF,
|
|
||||||
"Imported %dx%d %.4s:%#" G_GINT64_MODIFIER "x dmabuf as GL_TEXTURE_EXTERNAL_OES texture",
|
|
||||||
width, height,
|
|
||||||
(char *) &dmabuf->fourcc, dmabuf->modifier);
|
|
||||||
*external = TRUE;
|
|
||||||
return texture_id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
@@ -27,6 +27,15 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
GDK_GL_FEATURE_DEBUG = 1 << 0,
|
||||||
|
GDK_GL_FEATURE_UNPACK_SUBIMAGE = 1 << 1,
|
||||||
|
GDK_GL_FEATURE_VERTEX_HALF_FLOAT = 1 << 2,
|
||||||
|
GDK_GL_FEATURE_SYNC = 1 << 3,
|
||||||
|
GDK_GL_FEATURE_BASE_INSTANCE = 1 << 4,
|
||||||
|
GDK_GL_FEATURE_BUFFER_STORAGE = 1 << 5,
|
||||||
|
} GdkGLFeatures;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GDK_GL_NONE = 0,
|
GDK_GL_NONE = 0,
|
||||||
GDK_GL_EGL,
|
GDK_GL_EGL,
|
||||||
@@ -142,7 +151,6 @@ void gdk_gl_context_get_matching_version (GdkGLContext
|
|||||||
gboolean legacy,
|
gboolean legacy,
|
||||||
GdkGLVersion *out_version);
|
GdkGLVersion *out_version);
|
||||||
|
|
||||||
gboolean gdk_gl_context_has_unpack_subimage (GdkGLContext *context);
|
|
||||||
void gdk_gl_context_push_debug_group (GdkGLContext *context,
|
void gdk_gl_context_push_debug_group (GdkGLContext *context,
|
||||||
const char *message);
|
const char *message);
|
||||||
void gdk_gl_context_push_debug_group_printf (GdkGLContext *context,
|
void gdk_gl_context_push_debug_group_printf (GdkGLContext *context,
|
||||||
@@ -163,14 +171,11 @@ const char * gdk_gl_context_get_glsl_version_string (GdkGLContext
|
|||||||
|
|
||||||
GdkGLMemoryFlags gdk_gl_context_get_format_flags (GdkGLContext *self,
|
GdkGLMemoryFlags gdk_gl_context_get_format_flags (GdkGLContext *self,
|
||||||
GdkMemoryFormat format) G_GNUC_PURE;
|
GdkMemoryFormat format) G_GNUC_PURE;
|
||||||
gboolean gdk_gl_context_has_debug (GdkGLContext *self) G_GNUC_PURE;
|
gboolean gdk_gl_context_has_feature (GdkGLContext *self,
|
||||||
|
GdkGLFeatures feature) G_GNUC_PURE;
|
||||||
|
|
||||||
gboolean gdk_gl_context_use_es_bgra (GdkGLContext *context);
|
gboolean gdk_gl_context_use_es_bgra (GdkGLContext *context);
|
||||||
|
|
||||||
gboolean gdk_gl_context_has_vertex_half_float (GdkGLContext *self) G_GNUC_PURE;
|
|
||||||
|
|
||||||
gboolean gdk_gl_context_has_sync (GdkGLContext *self) G_GNUC_PURE;
|
|
||||||
|
|
||||||
gboolean gdk_gl_context_has_vertex_arrays (GdkGLContext *self) G_GNUC_PURE;
|
gboolean gdk_gl_context_has_vertex_arrays (GdkGLContext *self) G_GNUC_PURE;
|
||||||
|
|
||||||
double gdk_gl_context_get_scale (GdkGLContext *self);
|
double gdk_gl_context_get_scale (GdkGLContext *self);
|
||||||
|
@@ -494,7 +494,7 @@ gdk_gl_texture_new_from_builder (GdkGLTextureBuilder *builder,
|
|||||||
self->id = gdk_gl_texture_builder_get_id (builder);
|
self->id = gdk_gl_texture_builder_get_id (builder);
|
||||||
GDK_TEXTURE (self)->format = gdk_gl_texture_builder_get_format (builder);
|
GDK_TEXTURE (self)->format = gdk_gl_texture_builder_get_format (builder);
|
||||||
self->has_mipmap = gdk_gl_texture_builder_get_has_mipmap (builder);
|
self->has_mipmap = gdk_gl_texture_builder_get_has_mipmap (builder);
|
||||||
if (gdk_gl_context_has_sync (self->context))
|
if (gdk_gl_context_has_feature (self->context, GDK_GL_FEATURE_SYNC))
|
||||||
self->sync = gdk_gl_texture_builder_get_sync (builder);
|
self->sync = gdk_gl_texture_builder_get_sync (builder);
|
||||||
self->destroy = destroy;
|
self->destroy = destroy;
|
||||||
self->data = data;
|
self->data = data;
|
||||||
|
@@ -744,3 +744,11 @@ gdk_monitor_set_description (GdkMonitor *monitor,
|
|||||||
g_object_notify_by_pspec (G_OBJECT (monitor), props[PROP_DESCRIPTION]);
|
g_object_notify_by_pspec (G_OBJECT (monitor), props[PROP_DESCRIPTION]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define MM_PER_INCH 25.4
|
||||||
|
|
||||||
|
double
|
||||||
|
gdk_monitor_get_dpi (GdkMonitor *monitor)
|
||||||
|
{
|
||||||
|
return MAX ((monitor->geometry.width * monitor->scale) / (monitor->width_mm / MM_PER_INCH),
|
||||||
|
(monitor->geometry.height * monitor->scale) / (monitor->height_mm / MM_PER_INCH));
|
||||||
|
}
|
||||||
|
@@ -76,6 +76,7 @@ void gdk_monitor_set_subpixel_layout (GdkMonitor *monitor,
|
|||||||
void gdk_monitor_invalidate (GdkMonitor *monitor);
|
void gdk_monitor_invalidate (GdkMonitor *monitor);
|
||||||
void gdk_monitor_set_description (GdkMonitor *monitor,
|
void gdk_monitor_set_description (GdkMonitor *monitor,
|
||||||
const char *description);
|
const char *description);
|
||||||
|
double gdk_monitor_get_dpi (GdkMonitor *monitor);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@@ -59,7 +59,7 @@ typedef enum {
|
|||||||
* @get_current_image: return a `GdkPaintable` that does not change over
|
* @get_current_image: return a `GdkPaintable` that does not change over
|
||||||
* time. This means the `GDK_PAINTABLE_STATIC_SIZE` and
|
* time. This means the `GDK_PAINTABLE_STATIC_SIZE` and
|
||||||
* `GDK_PAINTABLE_STATIC_CONTENTS` flag are set.
|
* `GDK_PAINTABLE_STATIC_CONTENTS` flag are set.
|
||||||
* @get_flags: Get the flags for this instance. See [enum@Gdk.PaintableFlags]
|
* @get_flags: Get the flags for this instance. See [flags@Gdk.PaintableFlags]
|
||||||
* for details.
|
* for details.
|
||||||
* @get_intrinsic_width: The preferred width for this object to be
|
* @get_intrinsic_width: The preferred width for this object to be
|
||||||
* snapshot at or 0 if none. This is purely a hint. The object must still
|
* snapshot at or 0 if none. This is purely a hint. The object must still
|
||||||
|
@@ -98,9 +98,9 @@ gdk_rgba_free (GdkRGBA *rgba)
|
|||||||
* Returns: %TRUE if the @rgba is clear
|
* Returns: %TRUE if the @rgba is clear
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
gdk_rgba_is_clear (const GdkRGBA *rgba)
|
(gdk_rgba_is_clear) (const GdkRGBA *rgba)
|
||||||
{
|
{
|
||||||
return rgba->alpha < ((float) 0x00ff / (float) 0xffff);
|
return _gdk_rgba_is_clear (rgba);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -115,9 +115,9 @@ gdk_rgba_is_clear (const GdkRGBA *rgba)
|
|||||||
* Returns: %TRUE if the @rgba is opaque
|
* Returns: %TRUE if the @rgba is opaque
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
gdk_rgba_is_opaque (const GdkRGBA *rgba)
|
(gdk_rgba_is_opaque) (const GdkRGBA *rgba)
|
||||||
{
|
{
|
||||||
return rgba->alpha > ((float)0xff00 / (float)0xffff);
|
return _gdk_rgba_is_opaque (rgba);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SKIP_WHITESPACES(s) while (*(s) == ' ') (s)++;
|
#define SKIP_WHITESPACES(s) while (*(s) == ' ') (s)++;
|
||||||
@@ -368,21 +368,10 @@ gdk_rgba_hash (gconstpointer p)
|
|||||||
* Returns: %TRUE if the two colors compare equal
|
* Returns: %TRUE if the two colors compare equal
|
||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
gdk_rgba_equal (gconstpointer p1,
|
(gdk_rgba_equal) (gconstpointer p1,
|
||||||
gconstpointer p2)
|
gconstpointer p2)
|
||||||
{
|
{
|
||||||
const GdkRGBA *rgba1, *rgba2;
|
return _gdk_rgba_equal (p1, p2);
|
||||||
|
|
||||||
rgba1 = p1;
|
|
||||||
rgba2 = p2;
|
|
||||||
|
|
||||||
if (rgba1->red == rgba2->red &&
|
|
||||||
rgba1->green == rgba2->green &&
|
|
||||||
rgba1->blue == rgba2->blue &&
|
|
||||||
rgba1->alpha == rgba2->alpha)
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -43,5 +43,34 @@
|
|||||||
gboolean gdk_rgba_parser_parse (GtkCssParser *parser,
|
gboolean gdk_rgba_parser_parse (GtkCssParser *parser,
|
||||||
GdkRGBA *rgba);
|
GdkRGBA *rgba);
|
||||||
|
|
||||||
|
#define gdk_rgba_is_clear(rgba) _gdk_rgba_is_clear (rgba)
|
||||||
|
#define gdk_rgba_is_opaque(rgba) _gdk_rgba_is_opaque (rgba)
|
||||||
|
#define gdk_rgba_equal(p1, p2) _gdk_rgba_equal (p1, p2)
|
||||||
|
|
||||||
|
static inline gboolean
|
||||||
|
_gdk_rgba_is_clear (const GdkRGBA *rgba)
|
||||||
|
{
|
||||||
|
return rgba->alpha < ((float) 0x00ff / (float) 0xffff);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline gboolean
|
||||||
|
_gdk_rgba_is_opaque (const GdkRGBA *rgba)
|
||||||
|
{
|
||||||
|
return rgba->alpha > ((float)0xff00 / (float)0xffff);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline gboolean
|
||||||
|
_gdk_rgba_equal (gconstpointer p1,
|
||||||
|
gconstpointer p2)
|
||||||
|
{
|
||||||
|
const GdkRGBA *rgba1 = p1;
|
||||||
|
const GdkRGBA *rgba2 = p2;
|
||||||
|
|
||||||
|
return rgba1->red == rgba2->red &&
|
||||||
|
rgba1->green == rgba2->green &&
|
||||||
|
rgba1->blue == rgba2->blue &&
|
||||||
|
rgba1->alpha == rgba2->alpha;
|
||||||
|
}
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@@ -48,6 +48,14 @@ gdk_subsurface_class_init (GdkSubsurfaceClass *class)
|
|||||||
object_class->finalize = gdk_subsurface_finalize;
|
object_class->finalize = gdk_subsurface_finalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*< private >
|
||||||
|
* gdk_subsurface_get_parent:
|
||||||
|
* @subsurface: a `GdkSubsurface`
|
||||||
|
*
|
||||||
|
* Returns the parent surface of @subsurface.
|
||||||
|
*
|
||||||
|
* Returns: the parent surface
|
||||||
|
*/
|
||||||
GdkSurface *
|
GdkSurface *
|
||||||
gdk_subsurface_get_parent (GdkSubsurface *subsurface)
|
gdk_subsurface_get_parent (GdkSubsurface *subsurface)
|
||||||
{
|
{
|
||||||
@@ -108,15 +116,41 @@ insert_subsurface (GdkSubsurface *subsurface,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*< private >
|
||||||
|
* gdk_subsurface_attach:
|
||||||
|
* @subsurface: the `GdkSubsurface`
|
||||||
|
* @texture: the texture to attach. This typically has to be a `GdkDmabufTexture`
|
||||||
|
* @source: the source rectangle (i.e. the subset of the texture) to display
|
||||||
|
* @dest: the dest rectangle, in application pixels, relative to the parent surface.
|
||||||
|
* It must be integral in application and device pixels, or attaching will fail
|
||||||
|
* @transform: the transform to apply to the texture contents before displaying
|
||||||
|
* @background: (nullable): the background rectangle, in application pixels relative
|
||||||
|
* to the parent surface. This tells GDK to put a black background of this
|
||||||
|
* size below the subsurface. It must be integral in application and device pixels,
|
||||||
|
* or attaching will fail
|
||||||
|
* @above: whether the subsurface should be above its sibling
|
||||||
|
* @sibling: (nullable): the sibling subsurface to stack relative to, or `NULL` to
|
||||||
|
* stack relative to the parent surface
|
||||||
|
*
|
||||||
|
* Attaches content to a subsurface.
|
||||||
|
*
|
||||||
|
* This function takes all the necessary arguments to determine the subsurface
|
||||||
|
* configuration, including its position, size, content, background and stacking.
|
||||||
|
*
|
||||||
|
* Returns: `TRUE` if the attaching succeeded
|
||||||
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
gdk_subsurface_attach (GdkSubsurface *subsurface,
|
gdk_subsurface_attach (GdkSubsurface *subsurface,
|
||||||
GdkTexture *texture,
|
GdkTexture *texture,
|
||||||
const graphene_rect_t *source,
|
const graphene_rect_t *source,
|
||||||
const graphene_rect_t *dest,
|
const graphene_rect_t *dest,
|
||||||
|
GdkTextureTransform transform,
|
||||||
|
const graphene_rect_t *background,
|
||||||
gboolean above,
|
gboolean above,
|
||||||
GdkSubsurface *sibling)
|
GdkSubsurface *sibling)
|
||||||
{
|
{
|
||||||
GdkSurface *parent = subsurface->parent;
|
GdkSurface *parent = subsurface->parent;
|
||||||
|
gboolean result;
|
||||||
|
|
||||||
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), FALSE);
|
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), FALSE);
|
||||||
g_return_val_if_fail (GDK_IS_TEXTURE (texture), FALSE);
|
g_return_val_if_fail (GDK_IS_TEXTURE (texture), FALSE);
|
||||||
@@ -130,6 +164,15 @@ gdk_subsurface_attach (GdkSubsurface *subsurface,
|
|||||||
g_return_val_if_fail (sibling == NULL || GDK_IS_SUBSURFACE (sibling), FALSE);
|
g_return_val_if_fail (sibling == NULL || GDK_IS_SUBSURFACE (sibling), FALSE);
|
||||||
g_return_val_if_fail (sibling == NULL || sibling->parent == subsurface->parent, FALSE);
|
g_return_val_if_fail (sibling == NULL || sibling->parent == subsurface->parent, FALSE);
|
||||||
|
|
||||||
|
result = GDK_SUBSURFACE_GET_CLASS (subsurface)->attach (subsurface,
|
||||||
|
texture,
|
||||||
|
source,
|
||||||
|
dest,
|
||||||
|
transform,
|
||||||
|
background,
|
||||||
|
above,
|
||||||
|
sibling);
|
||||||
|
|
||||||
remove_subsurface (subsurface);
|
remove_subsurface (subsurface);
|
||||||
|
|
||||||
if (sibling)
|
if (sibling)
|
||||||
@@ -155,9 +198,17 @@ gdk_subsurface_attach (GdkSubsurface *subsurface,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return GDK_SUBSURFACE_GET_CLASS (subsurface)->attach (subsurface, texture, source, dest, above, sibling);
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*< private >
|
||||||
|
* gdk_subsurface_detach:
|
||||||
|
* @subsurface: a `GdkSubsurface`
|
||||||
|
*
|
||||||
|
* Hides the subsurface.
|
||||||
|
*
|
||||||
|
* To show it again, you need to call gdk_subsurface_attach().
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
gdk_subsurface_detach (GdkSubsurface *subsurface)
|
gdk_subsurface_detach (GdkSubsurface *subsurface)
|
||||||
{
|
{
|
||||||
@@ -168,6 +219,14 @@ gdk_subsurface_detach (GdkSubsurface *subsurface)
|
|||||||
GDK_SUBSURFACE_GET_CLASS (subsurface)->detach (subsurface);
|
GDK_SUBSURFACE_GET_CLASS (subsurface)->detach (subsurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*< private >
|
||||||
|
* gdk_subsurface_get_texture:
|
||||||
|
* @subsurface: a `GdkSubsurface`
|
||||||
|
*
|
||||||
|
* Gets the texture that is currently displayed by the subsurface.
|
||||||
|
*
|
||||||
|
* Returns: (nullable): the texture that is displayed
|
||||||
|
*/
|
||||||
GdkTexture *
|
GdkTexture *
|
||||||
gdk_subsurface_get_texture (GdkSubsurface *subsurface)
|
gdk_subsurface_get_texture (GdkSubsurface *subsurface)
|
||||||
{
|
{
|
||||||
@@ -176,30 +235,138 @@ gdk_subsurface_get_texture (GdkSubsurface *subsurface)
|
|||||||
return GDK_SUBSURFACE_GET_CLASS (subsurface)->get_texture (subsurface);
|
return GDK_SUBSURFACE_GET_CLASS (subsurface)->get_texture (subsurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*< private >
|
||||||
|
* gdk_subsurface_get_source_rect:
|
||||||
|
* @subsurface: a `GdkSubsurface`
|
||||||
|
* @rect: (out caller-allocates): return location for the rectangle
|
||||||
|
*
|
||||||
|
* Returns the source rect that was specified in the most recent
|
||||||
|
* gdk_subsurface_attach() call for @subsurface.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
gdk_subsurface_get_source (GdkSubsurface *subsurface,
|
gdk_subsurface_get_source_rect (GdkSubsurface *subsurface,
|
||||||
graphene_rect_t *source)
|
graphene_rect_t *rect)
|
||||||
{
|
{
|
||||||
g_return_if_fail (GDK_IS_SUBSURFACE (subsurface));
|
g_return_if_fail (GDK_IS_SUBSURFACE (subsurface));
|
||||||
g_return_if_fail (source != NULL);
|
g_return_if_fail (rect != NULL);
|
||||||
|
|
||||||
GDK_SUBSURFACE_GET_CLASS (subsurface)->get_source (subsurface, source);
|
GDK_SUBSURFACE_GET_CLASS (subsurface)->get_source_rect (subsurface, rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*< private >
|
||||||
|
* gdk_subsurface_get_texture_rect:
|
||||||
|
* @subsurface: a `GdkSubsurface`
|
||||||
|
* @rect: (out caller-allocates): return location for the rectangle
|
||||||
|
*
|
||||||
|
* Returns the texture rect that was specified in the most recent
|
||||||
|
* gdk_subsurface_attach() call for @subsurface.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
gdk_subsurface_get_dest (GdkSubsurface *subsurface,
|
gdk_subsurface_get_texture_rect (GdkSubsurface *subsurface,
|
||||||
graphene_rect_t *dest)
|
graphene_rect_t *rect)
|
||||||
{
|
{
|
||||||
g_return_if_fail (GDK_IS_SUBSURFACE (subsurface));
|
g_return_if_fail (GDK_IS_SUBSURFACE (subsurface));
|
||||||
g_return_if_fail (dest != NULL);
|
g_return_if_fail (rect != NULL);
|
||||||
|
|
||||||
GDK_SUBSURFACE_GET_CLASS (subsurface)->get_dest (subsurface, dest);
|
GDK_SUBSURFACE_GET_CLASS (subsurface)->get_texture_rect (subsurface, rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*< private >
|
||||||
|
* gdk_subsurface_is_above_parent:
|
||||||
|
* @subsurface: a `GdkSubsurface`
|
||||||
|
*
|
||||||
|
* Returns whether the subsurface is above the parent surface
|
||||||
|
* or below. Note that a subsurface can be above its parent
|
||||||
|
* surface, and still be covered by sibling subsurfaces.
|
||||||
|
*
|
||||||
|
* Returns: `TRUE` if @subsurface is above its parent
|
||||||
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
gdk_subsurface_is_above_parent (GdkSubsurface *subsurface)
|
gdk_subsurface_is_above_parent (GdkSubsurface *subsurface)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), TRUE);
|
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), FALSE);
|
||||||
|
|
||||||
return subsurface->above_parent;
|
return subsurface->above_parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*< private>
|
||||||
|
* gdk_subsurface_get_sibling:
|
||||||
|
* @subsurface: the `GdkSubsurface`
|
||||||
|
* @above: whether to get the subsurface above
|
||||||
|
*
|
||||||
|
* Returns the subsurface above (or below) @subsurface in
|
||||||
|
* the stacking order.
|
||||||
|
*
|
||||||
|
* Returns: the sibling, or `NULL` if there is none.
|
||||||
|
*/
|
||||||
|
GdkSubsurface *
|
||||||
|
gdk_subsurface_get_sibling (GdkSubsurface *subsurface,
|
||||||
|
gboolean above)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), NULL);
|
||||||
|
|
||||||
|
if (above)
|
||||||
|
return subsurface->sibling_above;
|
||||||
|
else
|
||||||
|
return subsurface->sibling_below;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*< private >
|
||||||
|
* gdk_subsurface_get_transform:
|
||||||
|
* @subsurface: a `GdkSubsurface`
|
||||||
|
*
|
||||||
|
* Returns the transform that was specified in the most recent call to
|
||||||
|
* gdk_subsurface_attach() call for @subsurface.
|
||||||
|
*
|
||||||
|
* Returns: the transform
|
||||||
|
*/
|
||||||
|
GdkTextureTransform
|
||||||
|
gdk_subsurface_get_transform (GdkSubsurface *subsurface)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), GDK_TEXTURE_TRANSFORM_NORMAL);
|
||||||
|
|
||||||
|
return GDK_SUBSURFACE_GET_CLASS (subsurface)->get_transform (subsurface);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*< private >
|
||||||
|
* gdk_subsurface_get_background_rect:
|
||||||
|
* @subsurface: a `GdkSubsurface`
|
||||||
|
* @rect: (out caller-allocates): return location for the rectangle
|
||||||
|
*
|
||||||
|
* Obtains the background rect that was specified in the most recent
|
||||||
|
* gdk_subsurface_attach() call for @subsurface.
|
||||||
|
*
|
||||||
|
* Returns: `TRUE` if @subsurface has a background
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
gdk_subsurface_get_background_rect (GdkSubsurface *subsurface,
|
||||||
|
graphene_rect_t *rect)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (GDK_IS_SUBSURFACE (subsurface), FALSE);
|
||||||
|
g_return_val_if_fail (rect != NULL, FALSE);
|
||||||
|
|
||||||
|
return GDK_SUBSURFACE_GET_CLASS (subsurface)->get_background_rect (subsurface, rect);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*< private >
|
||||||
|
* gdk_subsurface_get_bounds:
|
||||||
|
* @subsurface: a `GdkSubsurface`
|
||||||
|
* @bounds: (out caller-allocates): return location for the bounds
|
||||||
|
*
|
||||||
|
* Returns the bounds of the subsurface.
|
||||||
|
*
|
||||||
|
* The bounds are the union of the texture and background rects.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
gdk_subsurface_get_bounds (GdkSubsurface *subsurface,
|
||||||
|
graphene_rect_t *bounds)
|
||||||
|
{
|
||||||
|
graphene_rect_t background;
|
||||||
|
|
||||||
|
g_return_if_fail (GDK_IS_SUBSURFACE (subsurface));
|
||||||
|
g_return_if_fail (bounds != NULL);
|
||||||
|
|
||||||
|
gdk_subsurface_get_texture_rect (subsurface, bounds);
|
||||||
|
if (gdk_subsurface_get_background_rect (subsurface, &background))
|
||||||
|
graphene_rect_union (bounds, &background, bounds);
|
||||||
|
}
|
||||||
|
@@ -47,42 +47,68 @@ struct _GdkSubsurface
|
|||||||
GdkSubsurface *sibling_below;
|
GdkSubsurface *sibling_below;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
GDK_TEXTURE_TRANSFORM_NORMAL,
|
||||||
|
GDK_TEXTURE_TRANSFORM_90,
|
||||||
|
GDK_TEXTURE_TRANSFORM_180,
|
||||||
|
GDK_TEXTURE_TRANSFORM_270,
|
||||||
|
GDK_TEXTURE_TRANSFORM_FLIPPED,
|
||||||
|
GDK_TEXTURE_TRANSFORM_FLIPPED_90,
|
||||||
|
GDK_TEXTURE_TRANSFORM_FLIPPED_180,
|
||||||
|
GDK_TEXTURE_TRANSFORM_FLIPPED_270,
|
||||||
|
} GdkTextureTransform;
|
||||||
|
|
||||||
struct _GdkSubsurfaceClass
|
struct _GdkSubsurfaceClass
|
||||||
{
|
{
|
||||||
GObjectClass parent_class;
|
GObjectClass parent_class;
|
||||||
|
|
||||||
gboolean (* attach) (GdkSubsurface *subsurface,
|
gboolean (* attach) (GdkSubsurface *subsurface,
|
||||||
GdkTexture *texture,
|
GdkTexture *texture,
|
||||||
const graphene_rect_t *source,
|
const graphene_rect_t *source,
|
||||||
const graphene_rect_t *dest,
|
const graphene_rect_t *dest,
|
||||||
gboolean above,
|
GdkTextureTransform transform,
|
||||||
GdkSubsurface *sibling);
|
const graphene_rect_t *bg,
|
||||||
void (* detach) (GdkSubsurface *subsurface);
|
gboolean above,
|
||||||
GdkTexture * (* get_texture) (GdkSubsurface *subsurface);
|
GdkSubsurface *sibling);
|
||||||
void (* get_source) (GdkSubsurface *subsurface,
|
void (* detach) (GdkSubsurface *subsurface);
|
||||||
graphene_rect_t *source);
|
GdkTexture * (* get_texture) (GdkSubsurface *subsurface);
|
||||||
void (* get_dest) (GdkSubsurface *subsurface,
|
void (* get_source_rect) (GdkSubsurface *subsurface,
|
||||||
graphene_rect_t *dest);
|
graphene_rect_t *rect);
|
||||||
|
void (* get_texture_rect) (GdkSubsurface *subsurface,
|
||||||
|
graphene_rect_t *rect);
|
||||||
|
GdkTextureTransform
|
||||||
|
(* get_transform) (GdkSubsurface *subsurface);
|
||||||
|
gboolean (* get_background_rect) (GdkSubsurface *subsurface,
|
||||||
|
graphene_rect_t *rect);
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gdk_subsurface_get_type (void) G_GNUC_CONST;
|
GType gdk_subsurface_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
GdkSurface * gdk_subsurface_get_parent (GdkSubsurface *subsurface);
|
GdkSurface * gdk_subsurface_get_parent (GdkSubsurface *subsurface);
|
||||||
gboolean gdk_subsurface_attach (GdkSubsurface *subsurface,
|
|
||||||
GdkTexture *texture,
|
|
||||||
const graphene_rect_t *source,
|
|
||||||
const graphene_rect_t *dest,
|
|
||||||
gboolean above,
|
|
||||||
GdkSubsurface *sibling);
|
|
||||||
void gdk_subsurface_detach (GdkSubsurface *subsurface);
|
|
||||||
GdkTexture * gdk_subsurface_get_texture (GdkSubsurface *subsurface);
|
|
||||||
void gdk_subsurface_get_source (GdkSubsurface *subsurface,
|
|
||||||
graphene_rect_t *source);
|
|
||||||
void gdk_subsurface_get_dest (GdkSubsurface *subsurface,
|
|
||||||
graphene_rect_t *dest);
|
|
||||||
gboolean gdk_subsurface_is_above_parent (GdkSubsurface *subsurface);
|
|
||||||
|
|
||||||
|
gboolean gdk_subsurface_attach (GdkSubsurface *subsurface,
|
||||||
|
GdkTexture *texture,
|
||||||
|
const graphene_rect_t *source,
|
||||||
|
const graphene_rect_t *dest,
|
||||||
|
GdkTextureTransform transform,
|
||||||
|
const graphene_rect_t *background,
|
||||||
|
gboolean above,
|
||||||
|
GdkSubsurface *sibling);
|
||||||
|
void gdk_subsurface_detach (GdkSubsurface *subsurface);
|
||||||
|
GdkTexture * gdk_subsurface_get_texture (GdkSubsurface *subsurface);
|
||||||
|
void gdk_subsurface_get_source_rect (GdkSubsurface *subsurface,
|
||||||
|
graphene_rect_t *rect);
|
||||||
|
void gdk_subsurface_get_texture_rect (GdkSubsurface *subsurface,
|
||||||
|
graphene_rect_t *rect);
|
||||||
|
gboolean gdk_subsurface_is_above_parent (GdkSubsurface *subsurface);
|
||||||
|
GdkSubsurface * gdk_subsurface_get_sibling (GdkSubsurface *subsurface,
|
||||||
|
gboolean above);
|
||||||
|
GdkTextureTransform
|
||||||
|
gdk_subsurface_get_transform (GdkSubsurface *subsurface);
|
||||||
|
gboolean gdk_subsurface_get_background_rect (GdkSubsurface *subsurface,
|
||||||
|
graphene_rect_t *rect);
|
||||||
|
void gdk_subsurface_get_bounds (GdkSubsurface *subsurface,
|
||||||
|
graphene_rect_t *bounds);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@@ -563,7 +563,7 @@ gdk_texture_new_from_bytes_internal (GBytes *bytes,
|
|||||||
{
|
{
|
||||||
if (gdk_is_png (bytes))
|
if (gdk_is_png (bytes))
|
||||||
{
|
{
|
||||||
return gdk_load_png (bytes, error);
|
return gdk_load_png (bytes, NULL, error);
|
||||||
}
|
}
|
||||||
else if (gdk_is_jpeg (bytes))
|
else if (gdk_is_jpeg (bytes))
|
||||||
{
|
{
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
#include "gdkdmabuffourccprivate.h"
|
#include "gdkdmabuffourccprivate.h"
|
||||||
#include "gdkdmabuftextureprivate.h"
|
#include "gdkdmabuftextureprivate.h"
|
||||||
#include "gdkdisplayprivate.h"
|
#include "gdkdisplayprivate.h"
|
||||||
|
#include "gdkprofilerprivate.h"
|
||||||
#include <glib/gi18n-lib.h>
|
#include <glib/gi18n-lib.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
@@ -57,6 +58,9 @@ static const GdkDebugKey gsk_vulkan_feature_keys[] = {
|
|||||||
*
|
*
|
||||||
* Support for `GdkVulkanContext` is platform-specific and context creation
|
* Support for `GdkVulkanContext` is platform-specific and context creation
|
||||||
* can fail, returning %NULL context.
|
* can fail, returning %NULL context.
|
||||||
|
*
|
||||||
|
* Deprecated: 4.14: GTK does not expose any Vulkan internals. This
|
||||||
|
* struct is a leftover that was accidentally exposed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct _GdkVulkanContextPrivate GdkVulkanContextPrivate;
|
typedef struct _GdkVulkanContextPrivate GdkVulkanContextPrivate;
|
||||||
@@ -552,9 +556,8 @@ physical_device_supports_extension (VkPhysicalDevice device,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static GdkVulkanFeatures
|
||||||
physical_device_check_features (VkPhysicalDevice device,
|
physical_device_check_features (VkPhysicalDevice device)
|
||||||
GdkVulkanFeatures *out_features)
|
|
||||||
{
|
{
|
||||||
VkPhysicalDeviceVulkan12Features v12_features = {
|
VkPhysicalDeviceVulkan12Features v12_features = {
|
||||||
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES,
|
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES,
|
||||||
@@ -563,15 +566,16 @@ physical_device_check_features (VkPhysicalDevice device,
|
|||||||
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES,
|
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES,
|
||||||
.pNext = &v12_features
|
.pNext = &v12_features
|
||||||
};
|
};
|
||||||
VkPhysicalDeviceFeatures2 features = {
|
VkPhysicalDeviceFeatures2 v10_features = {
|
||||||
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2,
|
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2,
|
||||||
.pNext = &ycbcr_features
|
.pNext = &ycbcr_features
|
||||||
};
|
};
|
||||||
VkExternalSemaphoreProperties semaphore_props = {
|
VkExternalSemaphoreProperties semaphore_props = {
|
||||||
.sType = VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES,
|
.sType = VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES,
|
||||||
};
|
};
|
||||||
|
GdkVulkanFeatures features;
|
||||||
|
|
||||||
vkGetPhysicalDeviceFeatures2 (device, &features);
|
vkGetPhysicalDeviceFeatures2 (device, &v10_features);
|
||||||
vkGetPhysicalDeviceExternalSemaphoreProperties (device,
|
vkGetPhysicalDeviceExternalSemaphoreProperties (device,
|
||||||
&(VkPhysicalDeviceExternalSemaphoreInfo) {
|
&(VkPhysicalDeviceExternalSemaphoreInfo) {
|
||||||
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO,
|
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO,
|
||||||
@@ -579,46 +583,46 @@ physical_device_check_features (VkPhysicalDevice device,
|
|||||||
},
|
},
|
||||||
&semaphore_props);
|
&semaphore_props);
|
||||||
|
|
||||||
*out_features = 0;
|
features = 0;
|
||||||
|
|
||||||
if (features.features.shaderUniformBufferArrayDynamicIndexing &&
|
if (v10_features.features.shaderUniformBufferArrayDynamicIndexing &&
|
||||||
features.features.shaderSampledImageArrayDynamicIndexing)
|
v10_features.features.shaderSampledImageArrayDynamicIndexing)
|
||||||
*out_features |= GDK_VULKAN_FEATURE_DYNAMIC_INDEXING;
|
features |= GDK_VULKAN_FEATURE_DYNAMIC_INDEXING;
|
||||||
|
|
||||||
if (v12_features.descriptorIndexing &&
|
if (v12_features.descriptorIndexing &&
|
||||||
v12_features.descriptorBindingPartiallyBound &&
|
v12_features.descriptorBindingPartiallyBound &&
|
||||||
v12_features.descriptorBindingVariableDescriptorCount &&
|
v12_features.descriptorBindingVariableDescriptorCount &&
|
||||||
v12_features.descriptorBindingSampledImageUpdateAfterBind &&
|
v12_features.descriptorBindingSampledImageUpdateAfterBind &&
|
||||||
v12_features.descriptorBindingStorageBufferUpdateAfterBind)
|
v12_features.descriptorBindingStorageBufferUpdateAfterBind)
|
||||||
*out_features |= GDK_VULKAN_FEATURE_DESCRIPTOR_INDEXING;
|
features |= GDK_VULKAN_FEATURE_DESCRIPTOR_INDEXING;
|
||||||
else if (physical_device_supports_extension (device, VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME))
|
else if (physical_device_supports_extension (device, VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME))
|
||||||
*out_features |= GDK_VULKAN_FEATURE_DESCRIPTOR_INDEXING;
|
features |= GDK_VULKAN_FEATURE_DESCRIPTOR_INDEXING;
|
||||||
|
|
||||||
if (v12_features.shaderSampledImageArrayNonUniformIndexing &&
|
if (v12_features.shaderSampledImageArrayNonUniformIndexing &&
|
||||||
v12_features.shaderStorageBufferArrayNonUniformIndexing)
|
v12_features.shaderStorageBufferArrayNonUniformIndexing)
|
||||||
*out_features |= GDK_VULKAN_FEATURE_NONUNIFORM_INDEXING;
|
features |= GDK_VULKAN_FEATURE_NONUNIFORM_INDEXING;
|
||||||
|
|
||||||
if (ycbcr_features.samplerYcbcrConversion ||
|
if (ycbcr_features.samplerYcbcrConversion ||
|
||||||
physical_device_supports_extension (device, VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME))
|
physical_device_supports_extension (device, VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME))
|
||||||
*out_features |= GDK_VULKAN_FEATURE_YCBCR;
|
features |= GDK_VULKAN_FEATURE_YCBCR;
|
||||||
|
|
||||||
if (physical_device_supports_extension (device, VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME) &&
|
if (physical_device_supports_extension (device, VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME) &&
|
||||||
physical_device_supports_extension (device, VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME))
|
physical_device_supports_extension (device, VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME))
|
||||||
*out_features |= GDK_VULKAN_FEATURE_DMABUF;
|
features |= GDK_VULKAN_FEATURE_DMABUF;
|
||||||
|
|
||||||
if (physical_device_supports_extension (device, VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME))
|
if (physical_device_supports_extension (device, VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME))
|
||||||
{
|
{
|
||||||
if (semaphore_props.externalSemaphoreFeatures & VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT)
|
if (semaphore_props.externalSemaphoreFeatures & VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT)
|
||||||
*out_features |= GDK_VULKAN_FEATURE_SEMAPHORE_EXPORT;
|
features |= GDK_VULKAN_FEATURE_SEMAPHORE_EXPORT;
|
||||||
|
|
||||||
if (semaphore_props.externalSemaphoreFeatures & VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT)
|
if (semaphore_props.externalSemaphoreFeatures & VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT)
|
||||||
*out_features |= GDK_VULKAN_FEATURE_SEMAPHORE_IMPORT;
|
features |= GDK_VULKAN_FEATURE_SEMAPHORE_IMPORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (physical_device_supports_extension (device, VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME))
|
if (physical_device_supports_extension (device, VK_KHR_INCREMENTAL_PRESENT_EXTENSION_NAME))
|
||||||
*out_features |= GDK_VULKAN_FEATURE_INCREMENTAL_PRESENT;
|
features |= GDK_VULKAN_FEATURE_INCREMENTAL_PRESENT;
|
||||||
|
|
||||||
return TRUE;
|
return features;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -628,6 +632,7 @@ gdk_vulkan_context_begin_frame (GdkDrawContext *draw_context,
|
|||||||
{
|
{
|
||||||
GdkVulkanContext *context = GDK_VULKAN_CONTEXT (draw_context);
|
GdkVulkanContext *context = GDK_VULKAN_CONTEXT (draw_context);
|
||||||
GdkVulkanContextPrivate *priv = gdk_vulkan_context_get_instance_private (context);
|
GdkVulkanContextPrivate *priv = gdk_vulkan_context_get_instance_private (context);
|
||||||
|
VkResult acquire_result;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
if (depth != priv->current_format)
|
if (depth != priv->current_format)
|
||||||
@@ -649,12 +654,29 @@ gdk_vulkan_context_begin_frame (GdkDrawContext *draw_context,
|
|||||||
cairo_region_union (priv->regions[i], region);
|
cairo_region_union (priv->regions[i], region);
|
||||||
}
|
}
|
||||||
|
|
||||||
GDK_VK_CHECK (vkAcquireNextImageKHR, gdk_vulkan_context_get_device (context),
|
acquire_next_image:
|
||||||
priv->swapchain,
|
acquire_result = GDK_VK_CHECK (vkAcquireNextImageKHR, gdk_vulkan_context_get_device (context),
|
||||||
UINT64_MAX,
|
priv->swapchain,
|
||||||
priv->draw_semaphore,
|
UINT64_MAX,
|
||||||
VK_NULL_HANDLE,
|
priv->draw_semaphore,
|
||||||
&priv->draw_index);
|
VK_NULL_HANDLE,
|
||||||
|
&priv->draw_index);
|
||||||
|
if ((acquire_result == VK_ERROR_OUT_OF_DATE_KHR) ||
|
||||||
|
(acquire_result == VK_SUBOPTIMAL_KHR))
|
||||||
|
{
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
GDK_DEBUG (VULKAN, "Recreating the swapchain");
|
||||||
|
|
||||||
|
if (!gdk_vulkan_context_check_swapchain (context, &error))
|
||||||
|
{
|
||||||
|
g_warning ("%s", error->message);
|
||||||
|
g_error_free (error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
goto acquire_next_image;
|
||||||
|
}
|
||||||
|
|
||||||
cairo_region_union (region, priv->regions[priv->draw_index]);
|
cairo_region_union (region, priv->regions[priv->draw_index]);
|
||||||
}
|
}
|
||||||
@@ -1107,6 +1129,7 @@ gdk_display_load_pipeline_cache (GdkDisplay *display)
|
|||||||
static gboolean
|
static gboolean
|
||||||
gdk_vulkan_save_pipeline_cache (GdkDisplay *display)
|
gdk_vulkan_save_pipeline_cache (GdkDisplay *display)
|
||||||
{
|
{
|
||||||
|
G_GNUC_UNUSED gint64 begin_time = GDK_PROFILER_CURRENT_TIME;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
VkDevice device;
|
VkDevice device;
|
||||||
VkPipelineCache cache;
|
VkPipelineCache cache;
|
||||||
@@ -1121,14 +1144,13 @@ gdk_vulkan_save_pipeline_cache (GdkDisplay *display)
|
|||||||
GDK_VK_CHECK (vkGetPipelineCacheData, device, cache, &size, NULL);
|
GDK_VK_CHECK (vkGetPipelineCacheData, device, cache, &size, NULL);
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (size == display->vk_pipeline_cache_size)
|
if (size == display->vk_pipeline_cache_size)
|
||||||
{
|
{
|
||||||
GDK_DEBUG (VULKAN, "pipeline cache size (%zu bytes) unchanged, skipping save", size);
|
GDK_DEBUG (VULKAN, "pipeline cache size (%zu bytes) unchanged, skipping save", size);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
data = g_malloc (size);
|
data = g_malloc (size);
|
||||||
if (GDK_VK_CHECK (vkGetPipelineCacheData, device, cache, &size, data) != VK_SUCCESS)
|
if (GDK_VK_CHECK (vkGetPipelineCacheData, device, cache, &size, data) != VK_SUCCESS)
|
||||||
{
|
{
|
||||||
@@ -1148,7 +1170,7 @@ gdk_vulkan_save_pipeline_cache (GdkDisplay *display)
|
|||||||
|
|
||||||
file = gdk_vulkan_get_pipeline_cache_file (display);
|
file = gdk_vulkan_get_pipeline_cache_file (display);
|
||||||
|
|
||||||
GDK_DEBUG (VULKAN, "Saving pipeline cache to %s", g_file_peek_path (file));
|
GDK_DEBUG (VULKAN, "Saving pipeline cache of size %lu to %s", size, g_file_peek_path (file));
|
||||||
|
|
||||||
if (!g_file_replace_contents (file,
|
if (!g_file_replace_contents (file,
|
||||||
data,
|
data,
|
||||||
@@ -1163,7 +1185,7 @@ gdk_vulkan_save_pipeline_cache (GdkDisplay *display)
|
|||||||
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_WRONG_ETAG))
|
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_WRONG_ETAG))
|
||||||
{
|
{
|
||||||
VkPipelineCache new_cache;
|
VkPipelineCache new_cache;
|
||||||
|
|
||||||
GDK_DEBUG (VULKAN, "Pipeline cache file modified, merging into current");
|
GDK_DEBUG (VULKAN, "Pipeline cache file modified, merging into current");
|
||||||
new_cache = gdk_display_load_pipeline_cache (display);
|
new_cache = gdk_display_load_pipeline_cache (display);
|
||||||
if (new_cache)
|
if (new_cache)
|
||||||
@@ -1190,10 +1212,15 @@ gdk_vulkan_save_pipeline_cache (GdkDisplay *display)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gdk_profiler_end_markf (begin_time,
|
||||||
|
"Save Vulkan pipeline cache", "%s size %lu",
|
||||||
|
g_file_peek_path (file), size);
|
||||||
|
|
||||||
g_object_unref (file);
|
g_object_unref (file);
|
||||||
g_free (data);
|
g_free (data);
|
||||||
g_free (display->vk_pipeline_cache_etag);
|
g_free (display->vk_pipeline_cache_etag);
|
||||||
display->vk_pipeline_cache_etag = etag;
|
display->vk_pipeline_cache_etag = etag;
|
||||||
|
display->vk_pipeline_cache_size = size;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -1233,6 +1260,11 @@ gdk_display_create_pipeline_cache (GdkDisplay *display)
|
|||||||
},
|
},
|
||||||
NULL,
|
NULL,
|
||||||
&display->vk_pipeline_cache);
|
&display->vk_pipeline_cache);
|
||||||
|
GDK_DEBUG (VULKAN, "Creating empty pipeline cache");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GDK_DEBUG (VULKAN, "Loading pipeline cache (%lu bytes)", display->vk_pipeline_cache_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1342,6 +1374,7 @@ static gboolean
|
|||||||
gdk_display_create_vulkan_device (GdkDisplay *display,
|
gdk_display_create_vulkan_device (GdkDisplay *display,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
|
G_GNUC_UNUSED gint64 start_time = GDK_PROFILER_CURRENT_TIME;
|
||||||
uint32_t i, j, k;
|
uint32_t i, j, k;
|
||||||
const char *override;
|
const char *override;
|
||||||
gboolean list_devices;
|
gboolean list_devices;
|
||||||
@@ -1366,7 +1399,7 @@ gdk_display_create_vulkan_device (GdkDisplay *display,
|
|||||||
first = 0;
|
first = 0;
|
||||||
last = n_devices;
|
last = n_devices;
|
||||||
|
|
||||||
skip_features = gdk_parse_debug_var ("GDK_VULKAN_SKIP",
|
skip_features = gdk_parse_debug_var ("GDK_VULKAN_DISABLE",
|
||||||
gsk_vulkan_feature_keys,
|
gsk_vulkan_feature_keys,
|
||||||
G_N_ELEMENTS (gsk_vulkan_feature_keys));
|
G_N_ELEMENTS (gsk_vulkan_feature_keys));
|
||||||
|
|
||||||
@@ -1454,8 +1487,7 @@ gdk_display_create_vulkan_device (GdkDisplay *display,
|
|||||||
GdkVulkanFeatures features, device_features;
|
GdkVulkanFeatures features, device_features;
|
||||||
uint32_t n_queue_props;
|
uint32_t n_queue_props;
|
||||||
|
|
||||||
if (!physical_device_check_features (devices[i], &device_features))
|
device_features = physical_device_check_features (devices[i]);
|
||||||
continue;
|
|
||||||
|
|
||||||
features = device_features & ~skip_features;
|
features = device_features & ~skip_features;
|
||||||
|
|
||||||
@@ -1540,7 +1572,7 @@ gdk_display_create_vulkan_device (GdkDisplay *display,
|
|||||||
display->vk_queue_family_index = j;
|
display->vk_queue_family_index = j;
|
||||||
display->vulkan_features = features;
|
display->vulkan_features = features;
|
||||||
|
|
||||||
GDK_DISPLAY_DEBUG (display, VULKAN, "Enabled features (use GDK_VULKAN_SKIP env var to disable):");
|
GDK_DISPLAY_DEBUG (display, VULKAN, "Enabled features (use GDK_VULKAN_DISABLE env var to disable):");
|
||||||
for (i = 0; i < G_N_ELEMENTS (gsk_vulkan_feature_keys); i++)
|
for (i = 0; i < G_N_ELEMENTS (gsk_vulkan_feature_keys); i++)
|
||||||
{
|
{
|
||||||
GDK_DISPLAY_DEBUG (display, VULKAN, " %s: %s",
|
GDK_DISPLAY_DEBUG (display, VULKAN, " %s: %s",
|
||||||
@@ -1551,6 +1583,8 @@ gdk_display_create_vulkan_device (GdkDisplay *display,
|
|||||||
"Hum, what? This should not happen.")));
|
"Hum, what? This should not happen.")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gdk_profiler_end_mark (start_time, "Create Vulkan device", NULL);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1589,6 +1623,7 @@ static gboolean
|
|||||||
gdk_display_create_vulkan_instance (GdkDisplay *display,
|
gdk_display_create_vulkan_instance (GdkDisplay *display,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
|
G_GNUC_UNUSED gint64 start_time = GDK_PROFILER_CURRENT_TIME;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
GPtrArray *used_extensions;
|
GPtrArray *used_extensions;
|
||||||
GPtrArray *used_layers;
|
GPtrArray *used_layers;
|
||||||
@@ -1750,6 +1785,8 @@ gdk_display_create_vulkan_instance (GdkDisplay *display,
|
|||||||
|
|
||||||
display->vk_shader_modules = g_hash_table_new (g_str_hash, g_str_equal);
|
display->vk_shader_modules = g_hash_table_new (g_str_hash, g_str_equal);
|
||||||
|
|
||||||
|
gdk_profiler_end_mark (start_time, "Create Vulkan instance", NULL);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -127,15 +127,18 @@ png_simple_warning_callback (png_structp png,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* }}} */
|
/* }}} */
|
||||||
/* {{{ Public API */
|
/* {{{ Public API */
|
||||||
|
|
||||||
GdkTexture *
|
GdkTexture *
|
||||||
gdk_load_png (GBytes *bytes,
|
gdk_load_png (GBytes *bytes,
|
||||||
GError **error)
|
GHashTable *options,
|
||||||
|
GError **error)
|
||||||
{
|
{
|
||||||
png_io io;
|
png_io io;
|
||||||
png_struct *png = NULL;
|
png_struct *png = NULL;
|
||||||
png_info *info;
|
png_info *info;
|
||||||
|
png_textp text;
|
||||||
|
int num_texts;
|
||||||
guint width, height;
|
guint width, height;
|
||||||
gsize i, stride;
|
gsize i, stride;
|
||||||
int depth, color_type;
|
int depth, color_type;
|
||||||
@@ -297,6 +300,17 @@ gdk_load_png (GBytes *bytes,
|
|||||||
texture = gdk_memory_texture_new (width, height, format, out_bytes, stride);
|
texture = gdk_memory_texture_new (width, height, format, out_bytes, stride);
|
||||||
g_bytes_unref (out_bytes);
|
g_bytes_unref (out_bytes);
|
||||||
|
|
||||||
|
if (options && png_get_text (png, info, &text, &num_texts))
|
||||||
|
{
|
||||||
|
for (i = 0; i < num_texts; i++)
|
||||||
|
{
|
||||||
|
if (text->compression != -1)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
g_hash_table_insert (options, g_strdup (text->key), g_strdup (text->text));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
g_free (row_pointers);
|
g_free (row_pointers);
|
||||||
png_destroy_read_struct (&png, &info, NULL);
|
png_destroy_read_struct (&png, &info, NULL);
|
||||||
|
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#define PNG_SIGNATURE "\x89PNG"
|
#define PNG_SIGNATURE "\x89PNG"
|
||||||
|
|
||||||
GdkTexture *gdk_load_png (GBytes *bytes,
|
GdkTexture *gdk_load_png (GBytes *bytes,
|
||||||
|
GHashTable *options,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
GBytes *gdk_save_png (GdkTexture *texture);
|
GBytes *gdk_save_png (GdkTexture *texture);
|
||||||
|
@@ -296,10 +296,6 @@ typedef NSString *CALayerContentsGravity;
|
|||||||
GdkMonitor *monitor;
|
GdkMonitor *monitor;
|
||||||
GdkRectangle geometry;
|
GdkRectangle geometry;
|
||||||
GdkRectangle workarea;
|
GdkRectangle workarea;
|
||||||
int shadow_top = 0;
|
|
||||||
int shadow_left = 0;
|
|
||||||
int shadow_right = 0;
|
|
||||||
int shadow_bottom = 0;
|
|
||||||
GdkRectangle window_gdk;
|
GdkRectangle window_gdk;
|
||||||
GdkPoint pointer_position;
|
GdkPoint pointer_position;
|
||||||
GdkPoint new_origin;
|
GdkPoint new_origin;
|
||||||
@@ -307,13 +303,6 @@ typedef NSString *CALayerContentsGravity;
|
|||||||
if (!inManualMove)
|
if (!inManualMove)
|
||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
/* Get our shadow so we can adjust the window position sans-shadow */
|
|
||||||
_gdk_macos_surface_get_shadow (gdk_surface,
|
|
||||||
&shadow_top,
|
|
||||||
&shadow_right,
|
|
||||||
&shadow_bottom,
|
|
||||||
&shadow_left);
|
|
||||||
|
|
||||||
windowFrame = [self frame];
|
windowFrame = [self frame];
|
||||||
currentLocation = [NSEvent mouseLocation];
|
currentLocation = [NSEvent mouseLocation];
|
||||||
|
|
||||||
@@ -339,21 +328,9 @@ typedef NSString *CALayerContentsGravity;
|
|||||||
window_gdk.width = windowFrame.size.width;
|
window_gdk.width = windowFrame.size.width;
|
||||||
window_gdk.height = windowFrame.size.height;
|
window_gdk.height = windowFrame.size.height;
|
||||||
|
|
||||||
/* Subtract our shadowin from the window */
|
|
||||||
window_gdk.x += shadow_left;
|
|
||||||
window_gdk.y += shadow_top;
|
|
||||||
window_gdk.width = window_gdk.width - shadow_left - shadow_right;
|
|
||||||
window_gdk.height = window_gdk.height - shadow_top - shadow_bottom;
|
|
||||||
|
|
||||||
/* Now place things on the monitor */
|
/* Now place things on the monitor */
|
||||||
_edge_snapping_motion (&self->snapping, &pointer_position, &window_gdk);
|
_edge_snapping_motion (&self->snapping, &pointer_position, &window_gdk);
|
||||||
|
|
||||||
/* And add our shadow back to the frame */
|
|
||||||
window_gdk.x -= shadow_left;
|
|
||||||
window_gdk.y -= shadow_top;
|
|
||||||
window_gdk.width += shadow_left + shadow_right;
|
|
||||||
window_gdk.height += shadow_top + shadow_bottom;
|
|
||||||
|
|
||||||
/* Convert to quartz coordinates */
|
/* Convert to quartz coordinates */
|
||||||
_gdk_macos_display_to_display_coords ([self gdkDisplay],
|
_gdk_macos_display_to_display_coords ([self gdkDisplay],
|
||||||
window_gdk.x,
|
window_gdk.x,
|
||||||
@@ -715,26 +692,16 @@ typedef NSString *CALayerContentsGravity;
|
|||||||
|
|
||||||
-(void)setStyleMask:(NSWindowStyleMask)styleMask
|
-(void)setStyleMask:(NSWindowStyleMask)styleMask
|
||||||
{
|
{
|
||||||
gboolean was_fullscreen;
|
|
||||||
gboolean is_fullscreen;
|
|
||||||
gboolean was_opaque;
|
gboolean was_opaque;
|
||||||
gboolean is_opaque;
|
gboolean is_opaque;
|
||||||
|
|
||||||
was_fullscreen = (([self styleMask] & NSWindowStyleMaskFullScreen) != 0);
|
|
||||||
was_opaque = (([self styleMask] & NSWindowStyleMaskTitled) != 0);
|
was_opaque = (([self styleMask] & NSWindowStyleMaskTitled) != 0);
|
||||||
|
|
||||||
[super setStyleMask:styleMask];
|
[super setStyleMask:styleMask];
|
||||||
|
|
||||||
is_fullscreen = (([self styleMask] & NSWindowStyleMaskFullScreen) != 0);
|
|
||||||
is_opaque = (([self styleMask] & NSWindowStyleMaskTitled) != 0);
|
is_opaque = (([self styleMask] & NSWindowStyleMaskTitled) != 0);
|
||||||
|
|
||||||
if (was_fullscreen != is_fullscreen)
|
_gdk_macos_surface_update_fullscreen_state (gdk_surface);
|
||||||
{
|
|
||||||
if (was_fullscreen)
|
|
||||||
[self setFrame:lastUnfullscreenFrame display:NO];
|
|
||||||
|
|
||||||
_gdk_macos_surface_update_fullscreen_state (gdk_surface);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (was_opaque != is_opaque)
|
if (was_opaque != is_opaque)
|
||||||
{
|
{
|
||||||
@@ -747,17 +714,11 @@ typedef NSString *CALayerContentsGravity;
|
|||||||
|
|
||||||
-(NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
|
-(NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
|
||||||
{
|
{
|
||||||
GdkMacosSurface *surface = gdk_surface;
|
|
||||||
NSRect rect;
|
NSRect rect;
|
||||||
int shadow_top;
|
|
||||||
|
|
||||||
/* Allow the window to move up "shadow_top" more than normally allowed
|
|
||||||
* by the default impl. This makes it possible to move windows with
|
|
||||||
* client side shadow right up to the screen's menu bar. */
|
|
||||||
_gdk_macos_surface_get_shadow (surface, &shadow_top, NULL, NULL, NULL);
|
|
||||||
rect = [super constrainFrameRect:frameRect toScreen:screen];
|
rect = [super constrainFrameRect:frameRect toScreen:screen];
|
||||||
if (frameRect.origin.y > rect.origin.y)
|
if (frameRect.origin.y > rect.origin.y)
|
||||||
rect.origin.y = MIN (frameRect.origin.y, rect.origin.y + shadow_top);
|
rect.origin.y = MIN (frameRect.origin.y, rect.origin.y);
|
||||||
|
|
||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
@@ -777,7 +738,6 @@ typedef NSString *CALayerContentsGravity;
|
|||||||
-(void)windowWillEnterFullScreen:(NSNotification *)aNotification
|
-(void)windowWillEnterFullScreen:(NSNotification *)aNotification
|
||||||
{
|
{
|
||||||
inFullscreenTransition = YES;
|
inFullscreenTransition = YES;
|
||||||
lastUnfullscreenFrame = [self frame];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)windowDidEnterFullScreen:(NSNotification *)aNotification
|
-(void)windowDidEnterFullScreen:(NSNotification *)aNotification
|
||||||
|
@@ -49,7 +49,6 @@
|
|||||||
|
|
||||||
EdgeSnapping snapping;
|
EdgeSnapping snapping;
|
||||||
|
|
||||||
NSRect lastUnfullscreenFrame;
|
|
||||||
BOOL inFullscreenTransition;
|
BOOL inFullscreenTransition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "gdkmacoscursor-private.h"
|
#include "gdkmacoscursor-private.h"
|
||||||
|
#include "gdkcursorprivate.h"
|
||||||
|
|
||||||
@interface NSCursor()
|
@interface NSCursor()
|
||||||
-(long long)_coreCursorType;
|
-(long long)_coreCursorType;
|
||||||
@@ -217,9 +218,25 @@ _gdk_macos_cursor_get_ns_cursor (GdkCursor *cursor)
|
|||||||
|
|
||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
{
|
{
|
||||||
nscursor = create_cursor_from_texture (gdk_cursor_get_texture (cursor),
|
GdkTexture *texture;
|
||||||
gdk_cursor_get_hotspot_x (cursor),
|
int hotspot_x, hotspot_y;
|
||||||
gdk_cursor_get_hotspot_y (cursor));
|
|
||||||
|
texture = gdk_cursor_get_texture (cursor);
|
||||||
|
hotspot_x = gdk_cursor_get_hotspot_x (cursor);
|
||||||
|
hotspot_y = gdk_cursor_get_hotspot_y (cursor);
|
||||||
|
|
||||||
|
if (texture == NULL)
|
||||||
|
{
|
||||||
|
int size = 32; // FIXME
|
||||||
|
int width, height;
|
||||||
|
|
||||||
|
texture = gdk_cursor_get_texture_for_size (cursor, size, 1,
|
||||||
|
&width, &height,
|
||||||
|
&hotspot_x, &hotspot_y);
|
||||||
|
}
|
||||||
|
|
||||||
|
nscursor = create_cursor_from_texture (texture, hotspot_x, hotspot_y);
|
||||||
|
|
||||||
return nscursor;
|
return nscursor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -161,7 +161,8 @@ void _gdk_macos_display_send_event (GdkMacosDisp
|
|||||||
void _gdk_macos_display_warp_pointer (GdkMacosDisplay *self,
|
void _gdk_macos_display_warp_pointer (GdkMacosDisplay *self,
|
||||||
int x,
|
int x,
|
||||||
int y);
|
int y);
|
||||||
NSEvent *_gdk_macos_display_get_nsevent (GdkEvent *event);
|
NSEvent *_gdk_macos_display_get_matching_nsevent (GdkEvent *event);
|
||||||
|
NSEvent *_gdk_macos_display_get_exact_nsevent (GdkEvent *event);
|
||||||
NSEvent *_gdk_macos_display_get_last_nsevent (void);
|
NSEvent *_gdk_macos_display_get_last_nsevent (void);
|
||||||
GdkDrag *_gdk_macos_display_find_drag (GdkMacosDisplay *self,
|
GdkDrag *_gdk_macos_display_find_drag (GdkMacosDisplay *self,
|
||||||
NSInteger sequence_number);
|
NSInteger sequence_number);
|
||||||
|
@@ -47,20 +47,20 @@ _gdk_macos_display_position_toplevel_with_parent (GdkMacosDisplay *self,
|
|||||||
/* Try to center on top of the parent but also try to make the whole thing
|
/* Try to center on top of the parent but also try to make the whole thing
|
||||||
* visible in case that lands us under the topbar/panel/etc.
|
* visible in case that lands us under the topbar/panel/etc.
|
||||||
*/
|
*/
|
||||||
parent_rect.x = parent->root_x + parent->shadow_left;
|
parent_rect.x = parent->root_x;
|
||||||
parent_rect.y = parent->root_y + parent->shadow_top;
|
parent_rect.y = parent->root_y;
|
||||||
parent_rect.width = GDK_SURFACE (parent)->width - parent->shadow_left - parent->shadow_right;
|
parent_rect.width = GDK_SURFACE (parent)->width;
|
||||||
parent_rect.height = GDK_SURFACE (parent)->height - parent->shadow_top - parent->shadow_bottom;
|
parent_rect.height = GDK_SURFACE (parent)->height;
|
||||||
|
|
||||||
surface_rect.width = GDK_SURFACE (surface)->width - surface->shadow_left - surface->shadow_right;
|
surface_rect.width = GDK_SURFACE (surface)->width;
|
||||||
surface_rect.height = GDK_SURFACE (surface)->height - surface->shadow_top - surface->shadow_bottom;
|
surface_rect.height = GDK_SURFACE (surface)->height;
|
||||||
surface_rect.x = parent_rect.x + ((parent_rect.width - surface_rect.width) / 2);
|
surface_rect.x = parent_rect.x + ((parent_rect.width - surface_rect.width) / 2);
|
||||||
surface_rect.y = parent_rect.y + ((parent_rect.height - surface_rect.height) / 2);
|
surface_rect.y = parent_rect.y + ((parent_rect.height - surface_rect.height) / 2);
|
||||||
|
|
||||||
_gdk_macos_monitor_clamp (GDK_MACOS_MONITOR (monitor), &surface_rect);
|
_gdk_macos_monitor_clamp (GDK_MACOS_MONITOR (monitor), &surface_rect);
|
||||||
|
|
||||||
*x = surface_rect.x - surface->shadow_left;
|
*x = surface_rect.x;
|
||||||
*y = surface_rect.y - surface->shadow_top;
|
*y = surface_rect.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline gboolean
|
static inline gboolean
|
||||||
@@ -99,15 +99,15 @@ _gdk_macos_display_position_toplevel (GdkMacosDisplay *self,
|
|||||||
gdk_macos_monitor_get_workarea (monitor, &workarea);
|
gdk_macos_monitor_get_workarea (monitor, &workarea);
|
||||||
|
|
||||||
/* First place at top-left of current monitor */
|
/* First place at top-left of current monitor */
|
||||||
surface_rect.width = GDK_SURFACE (surface)->width - surface->shadow_left - surface->shadow_right;
|
surface_rect.width = GDK_SURFACE (surface)->width;
|
||||||
surface_rect.height = GDK_SURFACE (surface)->height - surface->shadow_top - surface->shadow_bottom;
|
surface_rect.height = GDK_SURFACE (surface)->height;
|
||||||
surface_rect.x = workarea.x + ((workarea.width - surface_rect.width) / 2);
|
surface_rect.x = workarea.x + ((workarea.width - surface_rect.width) / 2);
|
||||||
surface_rect.y = workarea.y + ((workarea.height - surface_rect.height) / 2);
|
surface_rect.y = workarea.y + ((workarea.height - surface_rect.height) / 2);
|
||||||
|
|
||||||
_gdk_macos_monitor_clamp (GDK_MACOS_MONITOR (surface->best_monitor), &surface_rect);
|
_gdk_macos_monitor_clamp (GDK_MACOS_MONITOR (surface->best_monitor), &surface_rect);
|
||||||
|
|
||||||
*x = surface_rect.x - surface->shadow_left;
|
*x = surface_rect.x;
|
||||||
*y = surface_rect.y - surface->shadow_top;
|
*y = surface_rect.y;
|
||||||
|
|
||||||
/* Try to see if there are any other surfaces at this origin and if so,
|
/* Try to see if there are any other surfaces at this origin and if so,
|
||||||
* adjust until we get something better.
|
* adjust until we get something better.
|
||||||
@@ -119,11 +119,11 @@ _gdk_macos_display_position_toplevel (GdkMacosDisplay *self,
|
|||||||
*y += WARP_OFFSET_Y;
|
*y += WARP_OFFSET_Y;
|
||||||
|
|
||||||
/* If we reached the bottom right, just bail and try the workspace origin */
|
/* If we reached the bottom right, just bail and try the workspace origin */
|
||||||
if (*x + surface->shadow_left + WARP_OFFSET_X > workarea.x + workarea.width ||
|
if (*x + WARP_OFFSET_X > workarea.x + workarea.width ||
|
||||||
*y + surface->shadow_top + WARP_OFFSET_Y > workarea.y + workarea.height)
|
*y + WARP_OFFSET_Y > workarea.y + workarea.height)
|
||||||
{
|
{
|
||||||
*x = workarea.x - surface->shadow_left;
|
*x = workarea.x;
|
||||||
*y = workarea.y - surface->shadow_top;
|
*y = workarea.y;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -77,6 +77,9 @@ gdk_macos_display_get_setting (GdkDisplay *display,
|
|||||||
const char *setting,
|
const char *setting,
|
||||||
GValue *value)
|
GValue *value)
|
||||||
{
|
{
|
||||||
|
if (gdk_display_get_debug_flags (display) & GDK_DEBUG_DEFAULT_SETTINGS)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
return _gdk_macos_display_get_setting (GDK_MACOS_DISPLAY (display), setting, value);
|
return _gdk_macos_display_get_setting (GDK_MACOS_DISPLAY (display), setting, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -991,15 +994,41 @@ _gdk_macos_display_warp_pointer (GdkMacosDisplay *self,
|
|||||||
CGWarpMouseCursorPosition ((CGPoint) { x, y });
|
CGWarpMouseCursorPosition ((CGPoint) { x, y });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Find the matching `NSEvent` for an `GdkEvent`. This function
|
||||||
|
* return the `NSEvent`, also for rewritten `GdkEvent`'s.
|
||||||
|
*/
|
||||||
NSEvent *
|
NSEvent *
|
||||||
_gdk_macos_display_get_nsevent (GdkEvent *event)
|
_gdk_macos_display_get_matching_nsevent (GdkEvent *event)
|
||||||
{
|
{
|
||||||
for (const GList *iter = event_map.head; iter; iter = iter->next)
|
for (GList *iter = event_map.head; iter; iter = iter->next)
|
||||||
{
|
{
|
||||||
const GdkToNSEventMap *map = iter->data;
|
GdkToNSEventMap *map = iter->data;
|
||||||
|
|
||||||
|
if (map->gdk_event->event_type == event->event_type &&
|
||||||
|
map->gdk_event->device == event->device &&
|
||||||
|
map->gdk_event->time == event->time)
|
||||||
|
{
|
||||||
|
return map->nsevent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Find the matching `NSEvent` for the original `GdkEvent`.
|
||||||
|
* If an event was rewritten, it returns `NULL`.
|
||||||
|
*/
|
||||||
|
NSEvent *
|
||||||
|
_gdk_macos_display_get_exact_nsevent (GdkEvent *event)
|
||||||
|
{
|
||||||
|
for (GList *iter = event_map.head; iter; iter = iter->next)
|
||||||
|
{
|
||||||
|
GdkToNSEventMap *map = iter->data;
|
||||||
|
|
||||||
if (map->gdk_event == event)
|
if (map->gdk_event == event)
|
||||||
return map->nsevent;
|
{
|
||||||
|
return map->nsevent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@@ -738,7 +738,7 @@ gdk_macos_event_source_dispatch (GSource *source,
|
|||||||
|
|
||||||
if (!handled)
|
if (!handled)
|
||||||
{
|
{
|
||||||
NSEvent *nsevent = _gdk_macos_display_get_nsevent (event);
|
NSEvent *nsevent = _gdk_macos_display_get_exact_nsevent (event);
|
||||||
if (nsevent != NULL)
|
if (nsevent != NULL)
|
||||||
[NSApp sendEvent: nsevent];
|
[NSApp sendEvent: nsevent];
|
||||||
}
|
}
|
||||||
|
@@ -68,19 +68,10 @@ gdk_macos_popup_surface_layout (GdkMacosPopupSurface *self,
|
|||||||
monitor = _gdk_macos_surface_get_best_monitor (GDK_MACOS_SURFACE (self));
|
monitor = _gdk_macos_surface_get_best_monitor (GDK_MACOS_SURFACE (self));
|
||||||
gdk_macos_monitor_get_workarea (monitor, &bounds);
|
gdk_macos_monitor_get_workarea (monitor, &bounds);
|
||||||
|
|
||||||
gdk_popup_layout_get_shadow_width (layout,
|
|
||||||
&self->parent_instance.shadow_left,
|
|
||||||
&self->parent_instance.shadow_right,
|
|
||||||
&self->parent_instance.shadow_top,
|
|
||||||
&self->parent_instance.shadow_bottom);
|
|
||||||
|
|
||||||
gdk_surface_layout_popup_helper (GDK_SURFACE (self),
|
gdk_surface_layout_popup_helper (GDK_SURFACE (self),
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
self->parent_instance.shadow_left,
|
0, 0, 0, 0, /* shadow-left/right/top/bottom */
|
||||||
self->parent_instance.shadow_right,
|
|
||||||
self->parent_instance.shadow_top,
|
|
||||||
self->parent_instance.shadow_bottom,
|
|
||||||
monitor,
|
monitor,
|
||||||
&bounds,
|
&bounds,
|
||||||
self->layout,
|
self->layout,
|
||||||
|
@@ -61,11 +61,6 @@ struct _GdkMacosSurface
|
|||||||
int height;
|
int height;
|
||||||
} next_layout;
|
} next_layout;
|
||||||
|
|
||||||
int shadow_top;
|
|
||||||
int shadow_right;
|
|
||||||
int shadow_bottom;
|
|
||||||
int shadow_left;
|
|
||||||
|
|
||||||
cairo_rectangle_int_t next_frame;
|
cairo_rectangle_int_t next_frame;
|
||||||
|
|
||||||
gint64 pending_frame_counter;
|
gint64 pending_frame_counter;
|
||||||
@@ -91,16 +86,6 @@ CGDirectDisplayID _gdk_macos_surface_get_screen_id (GdkMacosSurface
|
|||||||
const char *_gdk_macos_surface_get_title (GdkMacosSurface *self);
|
const char *_gdk_macos_surface_get_title (GdkMacosSurface *self);
|
||||||
void _gdk_macos_surface_set_title (GdkMacosSurface *self,
|
void _gdk_macos_surface_set_title (GdkMacosSurface *self,
|
||||||
const char *title);
|
const char *title);
|
||||||
void _gdk_macos_surface_get_shadow (GdkMacosSurface *self,
|
|
||||||
int *top,
|
|
||||||
int *right,
|
|
||||||
int *bottom,
|
|
||||||
int *left);
|
|
||||||
void _gdk_macos_surface_set_shadow (GdkMacosSurface *self,
|
|
||||||
int top,
|
|
||||||
int right,
|
|
||||||
int bottom,
|
|
||||||
int left);
|
|
||||||
gboolean _gdk_macos_surface_is_opaque (GdkMacosSurface *self);
|
gboolean _gdk_macos_surface_is_opaque (GdkMacosSurface *self);
|
||||||
NSView *_gdk_macos_surface_get_view (GdkMacosSurface *self);
|
NSView *_gdk_macos_surface_get_view (GdkMacosSurface *self);
|
||||||
gboolean _gdk_macos_surface_get_modal_hint (GdkMacosSurface *self);
|
gboolean _gdk_macos_surface_get_modal_hint (GdkMacosSurface *self);
|
||||||
|
@@ -56,14 +56,6 @@ enum {
|
|||||||
|
|
||||||
static GParamSpec *properties [LAST_PROP];
|
static GParamSpec *properties [LAST_PROP];
|
||||||
|
|
||||||
static gboolean
|
|
||||||
window_is_fullscreen (GdkMacosSurface *self)
|
|
||||||
{
|
|
||||||
g_assert (GDK_IS_MACOS_SURFACE (self));
|
|
||||||
|
|
||||||
return ([self->window styleMask] & NSWindowStyleMaskFullScreen) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
_gdk_macos_surface_request_frame (GdkMacosSurface *self)
|
_gdk_macos_surface_request_frame (GdkMacosSurface *self)
|
||||||
{
|
{
|
||||||
@@ -244,32 +236,6 @@ gdk_macos_surface_get_scale (GdkSurface *surface)
|
|||||||
return [self->window backingScaleFactor];
|
return [self->window backingScaleFactor];
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
_gdk_macos_surface_set_shadow (GdkMacosSurface *surface,
|
|
||||||
int top,
|
|
||||||
int right,
|
|
||||||
int bottom,
|
|
||||||
int left)
|
|
||||||
{
|
|
||||||
GdkMacosSurface *self = (GdkMacosSurface *)surface;
|
|
||||||
|
|
||||||
g_assert (GDK_IS_MACOS_SURFACE (self));
|
|
||||||
|
|
||||||
if (self->shadow_top == top &&
|
|
||||||
self->shadow_right == right &&
|
|
||||||
self->shadow_bottom == bottom &&
|
|
||||||
self->shadow_left == left)
|
|
||||||
return;
|
|
||||||
|
|
||||||
self->shadow_top = top;
|
|
||||||
self->shadow_right = right;
|
|
||||||
self->shadow_bottom = bottom;
|
|
||||||
self->shadow_left = left;
|
|
||||||
|
|
||||||
if (top || right || bottom || left)
|
|
||||||
[self->window setHasShadow:NO];
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gdk_macos_surface_begin_frame (GdkMacosSurface *self)
|
gdk_macos_surface_begin_frame (GdkMacosSurface *self)
|
||||||
{
|
{
|
||||||
@@ -587,29 +553,6 @@ gdk_macos_surface_init (GdkMacosSurface *self)
|
|||||||
self->monitors = g_ptr_array_new_with_free_func (g_object_unref);
|
self->monitors = g_ptr_array_new_with_free_func (g_object_unref);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
_gdk_macos_surface_get_shadow (GdkMacosSurface *self,
|
|
||||||
int *top,
|
|
||||||
int *right,
|
|
||||||
int *bottom,
|
|
||||||
int *left)
|
|
||||||
{
|
|
||||||
|
|
||||||
g_return_if_fail (GDK_IS_MACOS_SURFACE (self));
|
|
||||||
|
|
||||||
if (top)
|
|
||||||
*top = self->shadow_top;
|
|
||||||
|
|
||||||
if (left)
|
|
||||||
*left = self->shadow_left;
|
|
||||||
|
|
||||||
if (bottom)
|
|
||||||
*bottom = self->shadow_bottom;
|
|
||||||
|
|
||||||
if (right)
|
|
||||||
*right = self->shadow_right;
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_gdk_macos_surface_is_opaque (GdkMacosSurface *self)
|
_gdk_macos_surface_is_opaque (GdkMacosSurface *self)
|
||||||
{
|
{
|
||||||
@@ -758,7 +701,7 @@ _gdk_macos_surface_update_fullscreen_state (GdkMacosSurface *self)
|
|||||||
g_return_if_fail (GDK_IS_MACOS_SURFACE (self));
|
g_return_if_fail (GDK_IS_MACOS_SURFACE (self));
|
||||||
|
|
||||||
state = GDK_SURFACE (self)->state;
|
state = GDK_SURFACE (self)->state;
|
||||||
is_fullscreen = window_is_fullscreen (self);
|
is_fullscreen = ([self->window styleMask] & NSWindowStyleMaskFullScreen) != 0;
|
||||||
was_fullscreen = (state & GDK_TOPLEVEL_STATE_FULLSCREEN) != 0;
|
was_fullscreen = (state & GDK_TOPLEVEL_STATE_FULLSCREEN) != 0;
|
||||||
|
|
||||||
if (is_fullscreen != was_fullscreen)
|
if (is_fullscreen != was_fullscreen)
|
||||||
@@ -1105,16 +1048,12 @@ _gdk_macos_surface_monitor_changed (GdkMacosSurface *self)
|
|||||||
|
|
||||||
g_set_object (&child->best_monitor, best);
|
g_set_object (&child->best_monitor, best);
|
||||||
|
|
||||||
area.x = self->root_x + GDK_SURFACE (child)->x + child->shadow_left;
|
area.x = self->root_x + GDK_SURFACE (child)->x;
|
||||||
area.y = self->root_y + GDK_SURFACE (child)->y + child->shadow_top;
|
area.y = self->root_y + GDK_SURFACE (child)->y;
|
||||||
area.width = GDK_SURFACE (child)->width - child->shadow_left - child->shadow_right;
|
area.width = GDK_SURFACE (child)->width;
|
||||||
area.height = GDK_SURFACE (child)->height - child->shadow_top - child->shadow_bottom;
|
area.height = GDK_SURFACE (child)->height;
|
||||||
|
|
||||||
_gdk_macos_monitor_clamp (GDK_MACOS_MONITOR (best), &area);
|
_gdk_macos_monitor_clamp (GDK_MACOS_MONITOR (best), &area);
|
||||||
|
|
||||||
area.x -= child->shadow_left;
|
|
||||||
area.y -= child->shadow_top;
|
|
||||||
|
|
||||||
_gdk_macos_surface_move (child, area.x, area.y);
|
_gdk_macos_surface_move (child, area.x, area.y);
|
||||||
gdk_surface_invalidate_rect (GDK_SURFACE (child), NULL);
|
gdk_surface_invalidate_rect (GDK_SURFACE (child), NULL);
|
||||||
}
|
}
|
||||||
|
@@ -152,13 +152,6 @@ _gdk_macos_toplevel_surface_compute_size (GdkSurface *surface)
|
|||||||
mask = GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE;
|
mask = GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size.shadow.is_valid)
|
|
||||||
_gdk_macos_surface_set_shadow (macos_surface,
|
|
||||||
size.shadow.top,
|
|
||||||
size.shadow.right,
|
|
||||||
size.shadow.bottom,
|
|
||||||
size.shadow.left);
|
|
||||||
|
|
||||||
_gdk_macos_surface_set_geometry_hints (macos_surface, &geometry, mask);
|
_gdk_macos_surface_set_geometry_hints (macos_surface, &geometry, mask);
|
||||||
|
|
||||||
if (surface->state & (GDK_TOPLEVEL_STATE_FULLSCREEN |
|
if (surface->state & (GDK_TOPLEVEL_STATE_FULLSCREEN |
|
||||||
|
@@ -61,7 +61,7 @@ gdk_macos_deps = [
|
|||||||
libgdk_c_args += ['-xobjective-c']
|
libgdk_c_args += ['-xobjective-c']
|
||||||
|
|
||||||
libgdk_macos = static_library('gdk-macos',
|
libgdk_macos = static_library('gdk-macos',
|
||||||
gdk_macos_sources, gdkconfig, gdkenum_h,
|
sources: [ gdk_macos_sources, gdk_gen_headers ],
|
||||||
include_directories: [ confinc, gdkinc, ],
|
include_directories: [ confinc, gdkinc, ],
|
||||||
c_args: [ libgdk_c_args, common_cflags, ],
|
c_args: [ libgdk_c_args, common_cflags, ],
|
||||||
link_with: [],
|
link_with: [],
|
||||||
|