Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (513)
6a81d5f0
wayland/surface: Fix sending preferred buffer transform
Apr 22, 2024
669d21da
x11: Drop obsolete libXrender dependency
Apr 22, 2024
fb8ac5df
wayland: Track current tablet tool focus surface
Apr 25, 2024
243890a6
wayland: Do not forget immediately of key press serials on key release
Apr 26, 2024
d9207ee4
Update Portuguese translation
Apr 28, 2024
0f11ef6c
Update Brazilian Portuguese translation
Apr 29, 2024
3155cf51
ci: Bump image
Apr 29, 2024
b67f94ca
wayland/subsurface: Hold sibling surface reference in placement ops
Apr 30, 2024
dd32f3b3
wayland/transaction: Check surface pointer validity in _ensure_entry
Apr 30, 2024
b620dbb1
kms/impl-device: Add function meta_kms_impl_device_has_cursor_plane_for
May 02, 2024
14e18de9
backends/native: Add fake cursor plane using impl_device's crtcs
May 02, 2024
f3a52551
backends/native: Remove unused meta_kms_device_add_fake_plane_in_impl
May 02, 2024
2a88a3eb
x11/window: Do not try to compare a wayland active window with X11
May 03, 2024
b422393b
x11/window: Add type-check guard to meta_window_x11_get_group()
May 03, 2024
31165c2d
x11/window: Add proper type guard to x11-specific public API calls
May 03, 2024
3dbe3668
ci: Run gnome-shell tests with the timeout multiplier set to 5
May 03, 2024
b69fc155
tests/wayland: Run with G_MESSAGES_DEBUG=all
May 03, 2024
52d5758f
tests/wayland: Add test for mapping clone of obstructed window
May 03, 2024
7a9883d5
window: Move implement_showing for the next commit
May 03, 2024
e509fc7f
window: Start in the activate suspend state until mapped
May 03, 2024
fc623c1e
build: Enable -Werror=shadow and fix related issues
May 06, 2024
6819296e
ci: Build our own gtk3 containing unreleased bug fix
May 07, 2024
57e16cf0
window/wayland: Constrain sporadic client resizes immediately
May 07, 2024
8c39a254
keybindings: Add refcounting to fix use-after-free for key handlers
May 07, 2024
22f67d10
tests: Add test case for keybinding remove race
May 07, 2024
1990f234
Update Hindi translation
May 12, 2024
9ed00280
color-manager: Move update_all_gamma helper up
May 14, 2024
09a6ff6e
color-manager: Call update_all_gamma from on_monitors_changed
May 14, 2024
da0bd303
core/anonymous-file: Support 0-sized files
May 15, 2024
1c7ed16d
Revert "wayland/surface: Check buffer size also for role-less surfaces"
May 15, 2024
1f1538be
x11/window: Compare input shape to client rect when undecorating
May 15, 2024
0ab5ff6e
clutter/transition: Do not call methods of a NULL ClutterAnimatable
May 16, 2024
5e6aee63
tests/runner: Make 'wait_reconfigure' actually wait for a reconfigure
May 17, 2024
8dc61152
test-runner: Add ability to perform basic divisions and multiplications
May 17, 2024
e005d035
boxes: Define cleanup function for MetaStrut and use auto-pointers
May 17, 2024
44c6d029
workspace: Clean structs using clear GSList utility function
May 17, 2024
e250bd1e
workspace: Add a private getter for builtin struts
May 17, 2024
ea7357f4
test-runner: Add ability to set strut with monitor-relative sizes
May 17, 2024
0bc87341
test-runner: Add support for `add_strut` command
May 17, 2024
8246071c
test-runner: Add ability to remove struts by side
May 17, 2024
3686b1cf
test-runner: Support parsing monitor-relative window positions
May 17, 2024
c544b38d
tests/stacking: Add test to verify that setting and adding struts works
May 17, 2024
fcdfc4c8
test-runner: Add command to reload monitors
May 17, 2024
9374fad2
tests/stacking: Add test for strut changes together with monitors changes
May 17, 2024
4eed39ed
test-runner: Add ability to perform actions on signals callbacks
May 17, 2024
6ab36f72
tests/stacking: Do struts toggling during monitor-changed event
May 17, 2024
e2e687c9
dbusmock/mocks-manager: Don't create a pipe for started templates
May 19, 2024
eaf69fde
ci: Create artifacts of meson logs in dist job
May 20, 2024
7a38e12e
egl: Don't free source error after propagating it
May 20, 2024
c13956fb
Use gboolean consts instead of C bools
May 20, 2024
638d3355
cogl: Drop CoglSwapChain
May 20, 2024
de335cb6
Add editorconfig file
May 21, 2024
97af5f87
wayland/xdg-shell: Update min/max window size also on geometry changes
May 21, 2024
b8c5ea4e
x11: Remove MUTTER_DISPLAY env variable
May 21, 2024
57527048
cogl: Remove COGL_RENDERER env variable
May 21, 2024
6fbf5f08
clutter: Drop unused const
May 21, 2024
5cac2434
cogl: Remove unused DEFAULT_DRIVER code
May 21, 2024
301c154f
tests/wayland-unit-tests: Make sure there are two workspaces
May 21, 2024
08c9a775
tests: Make sure XDG_CURRENT_DESKTOP is unset
May 21, 2024
ba93fcd3
wayland/subsurface: Make sure siblings are actually sub-surfaces
May 21, 2024
ad22833c
wayland/subsurface: Hold surface reference in placement ops
May 21, 2024
5749810d
Revert "wayland/subsurface: Drop unapplied subsurface state on unmap"
May 21, 2024
be4bf8da
wayland/surface: Keep applied sub-surface branch node linked up
May 21, 2024
8a862b10
kms/impl-device: Inhibit real-time scheduling when querying KMS state
May 22, 2024
326e4c15
ci: Bump base image and wayland-protocols dependency
May 22, 2024
69e791cd
wayland: Implement the XDG dialog protocol
May 22, 2024
c192f511
cogl: Add sync fd feature enum value
May 23, 2024
6b3a289a
wayland/drm-syncobj: Check for sync-fd cogl feature
May 23, 2024
79a79b34
wayland/popup: Only close popups if press count drops from 1 to 0
May 23, 2024
c0537096
pointer-constraints/native: Consider origin when checking constraints
May 23, 2024
d6868659
pointer-constraints/native: Warp locked pointer to correct position
May 23, 2024
d4907a96
pointer-constraints/native: Fix typo in function name
May 23, 2024
c3e62640
wayland/pointer-constraints: Disconnect focus surface handler early
May 23, 2024
650ef9b5
wayland/pointer-constraints: Don't steal regions for new constraints
May 23, 2024
0a46ca67
core: Include a small subset of xcursor in-tree
May 24, 2024
7f213c2a
x11: Use the embedded xcursor functions where possible
May 24, 2024
bb38601d
build: Don't check for sm dependency if x11 is disabled
May 24, 2024
42c534a0
build: Don't error out if startup_notification is enabled but not x11
May 24, 2024
bcfbc7fa
ci: Use `meson introspect` to generate artifact path
May 24, 2024
a66dab92
ci: Hook up release-module
May 24, 2024
ca1434ff
display: Fix a -Wmaybe-uninitialized warning
May 26, 2024
173332e9
tests: Fix a -Wmaybe-uninitialized warning
May 26, 2024
1b643534
dbus-interfaces: Add some docs to the IdleMonitor interface
May 26, 2024
dad9f64b
cogl: Don't allow overriding renderer constraints
May 26, 2024
c506c194
cogl: Don't allow overriding renderer winsys_id
May 26, 2024
b054a09a
cogl: Remove unnused Renderer.foreach_output
May 26, 2024
06dde49d
cogl/renderer: Remove dead code
May 27, 2024
b4b896d4
core: Move frame related types to x11
May 27, 2024
acbb14f3
window: Move has_custom_frame_extents to WindowX11
May 27, 2024
fff528cb
window: Remove shove titlebar onscreen functions
May 27, 2024
751ef5ab
window/x11: Add a is_ssd helper
May 27, 2024
70f8cc43
window: Move get_session_geometry to WindowX11
May 27, 2024
503c70e2
window: Replace get_titlebar usages
May 27, 2024
bcb069f4
window: Move frame field to WindowX11
May 27, 2024
d1b04ffb
window: Move frame_bounds to WindowX11
May 27, 2024
0f19c6f5
window: Stop caching frame_bounds
May 27, 2024
e3d3b257
window-private: Actually remove frame instance
May 27, 2024
0653b829
stack-tracker: Avoid multiple casts to Window type
May 27, 2024
c202662c
stack-tracker: Improve logging when an operation is ignored
May 27, 2024
5b1c0c21
stack-tracker: Improve documentation why we need to filter x11 windows
May 27, 2024
Expand all
Show whitespace changes
Inline
Side-by-side
.editorconfig
0 → 100644
View file @
faa99c8d
# SPDX-FileCopyrightText: 2021 The GTK Authors
# SPDX-License-Identifier: CC0-1.0
root
=
true
[*]
charset
=
utf-8
end_of_line
=
lf
trim_trailing_whitespace
=
true
[*.[ch]
]
indent_size
=
2
indent_style
=
space
insert_final_newline
=
true
# For the legacy tabs which still exist in the code:
tab_width
=
8
[*.xml]
indent_size
=
2
indent_style
=
space
[meson.build]
indent_size
=
2
indent_style
=
space
[*.md]
max_line_length
=
80
.gitlab-ci.yml
View file @
faa99c8d
...
...
@@ -3,6 +3,15 @@ include:
-
remote
:
'
https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/34f4ade99434043f88e164933f570301fd18b125/templates/ci-fairy.yml'
-
project
:
'
Infrastructure/openshift-images/gnome-release-service'
file
:
'
/ci-templates/release-module.yml'
-
component
:
gitlab.gnome.org/GNOME/citemplates/gnomeos-build-sysext@1.0.0-alpha
inputs
:
meson-options
:
-Dxwayland_initfd=enabled
-Dprofiler=true
build-sysext
:
before_script
:
-
.gitlab-ci/install-gnomeos-sysext-dependencies.sh $CI_PROJECT_DIR/extension
stages
:
-
review
...
...
@@ -87,7 +96,7 @@ variables:
-
.skip-git-clone
variables
:
FDO_DISTRIBUTION_VERSION
:
40
BASE_TAG
:
'
2024-0
4-29
.0'
BASE_TAG
:
'
2024-0
7-16
.0'
MUTTER_USER
:
'
meta-user'
FDO_DISTRIBUTION_PACKAGES
:
asciidoc
...
...
@@ -122,6 +131,7 @@ variables:
dnf builddep -y gnome-shell --setopt=install_weak_deps=False
dnf builddep -y kernel --setopt=install_weak_deps=False
dnf builddep -y gi-docgen --setopt=install_weak_deps=False
dnf builddep -y wayland --setopt=install_weak_deps=False
./.gitlab-ci/install-meson-project.sh \
https://gitlab.gnome.org/jadahl/catch.git \
...
...
@@ -131,9 +141,17 @@ variables:
https://gitlab.gnome.org/GNOME/gi-docgen.git \
main
./.gitlab-ci/install-common-dependencies.sh
rpm -e --nodeps gnome-bluetooth-libs-devel \
mutter mutter-devel \
gnome-shell
gnome-shell \
gtk3
# Contains fixes needed for tests not included in 3.24.33
./.gitlab-ci/install-meson-project.sh \
https://gitlab.gnome.org/GNOME/gtk.git \
gtk-3-24 46fe3224dd771b91e6976d5a632b452e2179a4f0
# Work-around for podman-push aborting on permission issue
# https://gitlab.gnome.org/Infrastructure/Infrastructure/-/issues/1247
...
...
@@ -355,6 +373,7 @@ check-code-style:
--warnlevel
2
-Dbuildtype=debugoptimized
-Db_coverage=true
-Ddocs=true
$BASE_MESON_OPTIONS
$EXTRA_MESON_OPTIONS
-
meson compile -C build
...
...
@@ -422,8 +441,29 @@ build-without-native-backend-and-wayland@x86_64:
-Dudev=false
-Dwayland=false
-Dxwayland=false
-Dcore_tests=false
-Dnative_tests=false
-Dtests=disabled
-Dintrospection=false
-
meson compile -C build
-
sudo meson install --no-rebuild -C build
artifacts
:
paths
:
-
build/meson-logs
build-wayland-xwayland@x86_64
:
extends
:
-
.mutter.distribution-image
-
.mutter.fedora@x86_64
stage
:
build
needs
:
-
job
:
build-fedora-container@x86_64
artifacts
:
false
script
:
-
meson setup . build --werror --prefix /usr
-Dbuildtype=debugoptimized
-Dwayland=true
-Dxwayland=true
-Dx11=false
-Dtests=disabled
-Dintrospection=false
-
meson compile -C build
-
sudo meson install --no-rebuild -C build
...
...
@@ -444,8 +484,8 @@ build-wayland-only@x86_64:
-Dbuildtype=debugoptimized
-Dwayland=true
-Dxwayland=false
-D
core_tests
=false
-D
native_tests=false
-D
x11
=false
-D
tests=disabled
-Dintrospection=false
-
meson compile -C build
-
sudo meson install --no-rebuild -C build
...
...
@@ -455,7 +495,6 @@ build-wayland-only@x86_64:
.test-setup
:
variables
:
XDG_RUNTIME_DIR
:
"
$CI_PROJECT_DIR/runtime-dir"
GSETTINGS_SCHEMA_DIR
:
"
$CI_PROJECT_DIR/build/data"
MUTTER_DEBUG_DUMMY_MODE_SPECS
:
"
800x600@10.0"
PIPEWIRE_DEBUG
:
2
...
...
@@ -467,9 +506,6 @@ build-wayland-only@x86_64:
GTK_A11Y
:
"
none"
before_script
:
-
!reference
[
.mutter.git-clone
,
before_script
]
# Disable e.g. audio support to not dead lock screen cast tests
-
mkdir -m 700 $XDG_RUNTIME_DIR
-
pipewire & sleep
2
.test-mutter-base
:
extends
:
...
...
@@ -500,9 +536,11 @@ build-wayland-only@x86_64:
-
.test-mutter-base
script
:
-
glib-compile-schemas $GSETTINGS_SCHEMA_DIR
-
xvfb-run -a -s "$XVFB_SERVER_ARGS"
./src/tests/meta-dbus-runner.py
-
mkdir -m 1777 /tmp/.X11-unix
-
./src/tests/meta-dbus-runner.py
--launch=pipewire
--launch=wireplumber
--
meson test
-C build
--setup plain
...
...
@@ -596,7 +634,14 @@ can-run-gnome-shell@x86_64:
-
.gitlab-ci/checkout-gnome-shell.sh
-
meson setup gnome-shell gnome-shell/build --prefix /usr -Dbuildtype=debugoptimized -Dman=false --werror --fatal-meson-warnings
-
sudo meson install -C gnome-shell/build
-
dbus-run-session -- xvfb-run meson test -C gnome-shell/build --no-rebuild --timeout-multiplier
5
-
mkdir -m 1777 /tmp/.X11-unix
-
dbus-run-session -- meson test -C gnome-shell/build --no-rebuild --timeout-multiplier
5
artifacts
:
expire_in
:
7 day
name
:
"
mutter-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when
:
on_failure
paths
:
-
gnome-shell/build/meson-logs
test-mutter-coverity
:
rules
:
...
...
@@ -661,9 +706,11 @@ dist-mutter:
-
meson setup . build --werror --prefix /usr
-Dbuildtype=debugoptimized
-
glib-compile-schemas $GSETTINGS_SCHEMA_DIR
-
xvfb-run -a -s "$XVFB_SERVER_ARGS"
./src/tests/meta-dbus-runner.py
-
mkdir -m 1777 /tmp/.X11-unix
-
./src/tests/meta-dbus-runner.py
--launch=pipewire
--launch=wireplumber
--
meson dist -C build
artifacts
:
expire_in
:
7 day
...
...
@@ -711,11 +758,8 @@ reference:
-
.mutter.fedora@x86_64
stage
:
docs
needs
:
-
job
:
build-fedora-container@x86_64
artifacts
:
false
-
build-mutter@x86_64
script
:
-
meson setup . build --werror -Ddocs=true -Dtests=false
-
ninja -C build
-
mkdir references
-
cp -r doc/website/* ./references
-
mv build/doc/reference/{cally/cally,clutter/clutter,cogl/cogl,cogl-pango/cogl-pango,meta/meta,mtk/mtk} references/
...
...
.gitlab-ci/install-common-dependencies.sh
0 → 100755
View file @
faa99c8d
#!/bin/bash
set
-e
usage
()
{
cat
<<-
EOF
Usage:
$(
basename
$0
)
[OPTION…]
Install common dependencies to a base image or system extension
Options:
--libdir Setup the projects with a different libdir
--destdir Install the projects to an additional destdir
-h, --help Display this help
EOF
}
TEMP
=
$(
getopt
\
--name
=
$(
basename
$0
)
\
--options
=
''
\
--longoptions
=
'libdir:'
\
--longoptions
=
'destdir:'
\
--longoptions
=
'help'
\
--
"
$@
"
)
eval set
--
"
$TEMP
"
unset
TEMP
OPTIONS
=()
while
true
;
do
case
"
$1
"
in
--libdir
)
OPTIONS+
=(
--libdir
=
$2
)
shift
2
;;
--destdir
)
OPTIONS+
=(
--destdir
=
$2
)
shift
2
;;
-h
|
--help
)
usage
exit
0
;;
--
)
shift
break
;;
esac
done
SCRIPTS_DIR
=
"
$(
dirname
$0
)
"
if
!
pkgconf
--atleast-version
1.23.0 wayland-server
then
./
$SCRIPTS_DIR
/install-meson-project.sh
\
"
${
OPTIONS
[@]
}
"
\
https://gitlab.freedesktop.org/wayland/wayland.git
\
1.23.0
fi
if
!
pkgconf
--atleast-version
1.36 wayland-protocols
then
./
$SCRIPTS_DIR
/install-meson-project.sh
\
"
${
OPTIONS
[@]
}
"
\
https://gitlab.freedesktop.org/wayland/wayland-protocols.git
\
1.36
fi
if
!
gsettings get org.gnome.desktop.interface accent-color
>
/dev/null 2>&1
then
./
$SCRIPTS_DIR
/install-meson-project.sh
\
"
${
OPTIONS
[@]
}
"
\
https://gitlab.gnome.org/GNOME/gsettings-desktop-schemas.git
\
master
fi
.gitlab-ci/install-gnomeos-sysext-dependencies.sh
0 → 100755
View file @
faa99c8d
#!/bin/bash
set
-e
SCRIPTS_DIR
=
"
$(
dirname
$0
)
"
# Location for dependencies to be bundled with the extension
DESTDIR
=
"
$(
realpath
$1
)
"
# GNOME OS specific setup arguments
LIBDIR
=
"lib/
$(
gcc
-print-multiarch
)
"
# Install common dependencies
./
$SCRIPTS_DIR
/install-common-dependencies.sh
--libdir
=
$LIBDIR
--destdir
=
$DESTDIR
# Install below missing dependencies that are exclusive to GNOME OS
.gitlab-ci/install-meson-project.sh
View file @
faa99c8d
...
...
@@ -12,6 +12,8 @@ usage() {
-Dkey=val Option to pass on to meson
--subdir Build subdirectory instead of whole project
--prepare Script to run before build
--libdir Setup the project with a different libdir
--destdir Install the project to an additional destdir
-h, --help Display this help
...
...
@@ -23,6 +25,8 @@ TEMP=$(getopt \
--options
=
'D:h'
\
--longoptions
=
'subdir:'
\
--longoptions
=
'prepare:'
\
--longoptions
=
'libdir:'
\
--longoptions
=
'destdir:'
\
--longoptions
=
'help'
\
--
"
$@
"
)
...
...
@@ -32,6 +36,7 @@ unset TEMP
MESON_OPTIONS
=()
SUBDIR
=
.
PREPARE
=
:
DESTDIR
=
""
while
true
;
do
case
"
$1
"
in
...
...
@@ -50,6 +55,16 @@ while true; do
shift
2
;;
--libdir
)
MESON_OPTIONS+
=(
--libdir
=
$2
)
shift
2
;;
--destdir
)
DESTDIR
=
$2
shift
2
;;
-h
|
--help
)
usage
exit
0
...
...
@@ -78,5 +93,11 @@ git clone --depth 1 "$REPO_URL" -b "$COMMIT" "$CHECKOUT_DIR"
pushd
"
$CHECKOUT_DIR
/
$SUBDIR
"
sh
-c
"
$PREPARE
"
meson setup
--prefix
=
/usr _build
"
${
MESON_OPTIONS
[@]
}
"
meson
install
-C
_build
# Install it to an additional directory e.g., system extension directory
if
[
-n
"
${
DESTDIR
}
"
]
;
then
sudo
meson
install
-C
_build
--destdir
=
$DESTDIR
fi
sudo
meson
install
-C
_build
popd
NEWS
View file @
faa99c8d
46.4
====
* Fix nested popovers on wayland [Carlos; !3874]
* Misc. bug fixes and cleanups [Robert, Jonas; !3906, !3329]
Contributors:
Jonas Ådahl, Carlos Garnacho, Robert Mader
Translators:
Jürgen Benvenuti [de], Chao-Hsiung Liao [zh_TW]
46.3.1
======
47.beta
=======
* Fix visibility of Xwayland windows [Michel; !3862]
* Misc. bug fixes [Marco; !2959]
Contributors:
Michel Dänzer, Marco Trevisan (Treviño)
46.3
====
* Fix performance issues with second virtual monitor [Jonas; !3803]
* Fix missing unmap animation of some windows [Michel; !3840]
* Fix placement/resizing regression [Jonas; #2616]
* Fix possible out of sync primary selections and clipboard [Carlos; !3789]
* Fix ibus support in popups [Sebastian K.; !3787]
* Fix hardware accelerated rendering when headless [Jonas; !3805]
* Add back support for legacy X11 cursor themes [Daniel; !3718]
* Fix preedit offsets [Orko; !3845]
* Use character offsets to specify surrounding text [Shiki; !3719]
* Don't force titlebar on screen on all interactive resizes [Jeffrey; !3764]
* Fixed crashes [Carlos, Sebastian W., Michel; !3729, !3783, !3849]
* Misc. bug fixes and cleanups [Daniel, Philip, Marco, José, Jonas, Pascal,
Corentin; #3368, !3770, !3788, !3791, !3809, !3811, !3827, !3790]
Contributors:
Jonas Ådahl, Michel Dänzer, José Expósito, Orko Garai, Carlos Garnacho,
Sebastian Keller, Jeffrey Knockel, Corentin Noël, Pascal Nowack,
Shiki Okasaka, Marco Trevisan (Treviño), Daniel van Vugt, Sebastian Wick,
Philip Withnall
* Add plumbing for transforming color state [Jonas; !3433]
* Build and publish GNOME OS systemd-sysext extensions [Martin; !3843]
* Implement support for tablet tool keybindings and actions [Peter; !3649]
* Add support for tablet tool pressure ranges [Peter; !3794]
* Improve sticky behavior with transient dialogs [Jonas; !3870]
* Improve placement and focus logic with always-on-top windows [Jonas; !3879]
* Expose Orientationmanager to introspection [Ivan; !3880]
* Recover from secondary GPU update failures [Daniel; !3817]
* Plugged leaks [Sebastian K.; !3884, !3888]
* Misc. bug fixes and cleanups [Carlos, Michel, Sebastian W., Pascal, Florian,
Martin, Bilal, Daniel, Jonas, Robert; !3860, !3848, !3867, !3869, !3871,
!3740, !3872, !3883, !3857, !3885, !3891, !3895, !3898, !3896, !3887, !3901,
!3897, !3902, !3329, !3894, !3903, !3906, !3909, !3905, !3910]
Contributors:
Jonas Ådahl, Michel Dänzer, Bilal Elmoussaoui, Carlos Garnacho,
Peter Hutterer, Sebastian Keller, Ivan Kuzmenko, Martin Abente Lahaye,
Robert Mader, Florian Müllner, Pascal Nowack, Daniel van Vugt, Sebastian Wick
Translators:
Scrambled 777 [hi], Jose Riha [sk], Pawan Chitrakar [ne], Милош Поповић [sr
]
Chao-Hsiung Liao [zh_TW
]
46.2
====
* Fix hardware cursor with non-atomic KMS drivers [Daniel; !3676]
* Fix night light state getting stuck on monitor changes [Michel; !3742]
47.alpha
========
* Fix sending preferred buffer transform [Robert; !3717]
* Fix key press events with immediate release being ignored [Carlos; !3721]
* Fix hardware cursor with non-atomic KMS drivers [Daniel; !3676]
* Fix night light state getting stuck on monitor changes [Michel; !3742]
* Fix unsetting clipboard on screen lock [Florian; !3752]
* Fix wrong input region of undecorated X11 windows [Sebastian K.; !3720]
* Fix windows potentially shrinking unexpectedly on configure [Jonas Å.; !3755]
* Implement XDG dialog protocol [Carlos; !3557]
* Fix popup menus sometimes closing immediately [Jonas D.; !3631]
* Fixed crashes [Michel, Carlos, Keyu, Jonas Å., Sebastian K.; !3725, !3763,
!3715, !3711, !3758, !3749]
* Misc. bug fixes and cleanups [Florian, Echo, Michel, Jonas Å., Sebastian W.,
Corentin, Bilal; !3723, !3744, !3737, !3743, !3735, !3731, !3700, !3750,
!3757, !3754, !3748, !3730, !3775]
Contributors:
Jonas Ådahl, Michel Dänzer, Jonas Dreßler, Bilal Elmoussaoui, Carlos Garnacho,
Echo J, Sebastian Keller, Robert Mader, Florian Müllner, Corentin Noël,
Keyu Tao, Marco Trevisan (Treviño), Daniel van Vugt, Sebastian Wick
* Allow building without X11 support [Bilal; !3607, !3765, !3254, !3776, !3853]
* Emit signal when accelerator is deactivated [dcz; !3680]
* Fix wrong pointer cursor during compositor grabs [Carlos; !3736]
* Fix possible out of sync primary selections and clipboard [Carlos; !3789]
* Improve monitor matching when restoring windows on hotplug [Jonas Å.; !3753]
* Add support for SIZE_HINTS cursor plane property [adarshgm; !3165]
* Fix ibus support in popups [Sebastian K.; !3787]
* Delay xdg-activation requests until window is mapped [Sebastian W.; !3728]
* Fix hardware accelerated rendering when headless [Jonas Å.; !3805]
* Merge ClutterColor and CoglColor [Bilal; !3796, !3802, !3544]
* Fix performance issues with second virtual monitor [Jonas Å.; !3803]
* Add back support for legacy X11 cursor themes [Daniel; !3718]
* Add support for DRM lease protocol [Sebastian W., Jonas Å., José; !3746]
* Base test backend on native backend instead of X11 [Jonas Å.; !3812]
* Fix missing unmap animation of some windows [Michel; !3840]
* Fix preedit offsets [Orko; !3845]
* Use character offsets to specify surrounding text [Shiki; !3719]
* Don't force titlebar on screen on all interactive resizes [Jeffrey; !3764]
* Fixed crashes [Carlos, Michel, Keyu, Jonas Å., Sebastian K., Marco, Georges,
Sebastian W.; !3715, !3725, !3711, !3758, !3763, !3749, !3732, !3729, !3828,
!3783, !3849]
* Misc. bug fixes and cleanups [Mart, Florian, Marco, Jonas Å., Sebastian W.,
Bilal, Michel, Corentin, Georges, Philip, Daniel, Jonas D., José, Pascal,
Carlos; !3716, !3723, !3727, !3735, !3731, !3378, !3700, !3743, !3750, !3701,
!3757, !3754, !3748, !3759, !3761, !3762, !3730, !3737, !3771, !3775, !3770,
!3768, !3781, !3782, !3784, !3788, !3791, !2959, !3792, !3265, !3801, !3804,
!3795, !3693, !3793, !3800, !3115, !3806, !3809, !3810, !3816, !3811, !3667,
!3799, !3823, !3818, !3813, !3814, !3807, !3827, !3826, !3831, !3829, !3830,
!3798, !3833, !3836, !3837, !3835, !3820, !3822, #3540, !3842, !3851, !3747,
!3790]
Contributors:
Jonas Ådahl, adarshgm, Michel Dänzer, dcz, Jonas Dreßler, Bilal Elmoussaoui,
José Expósito, Orko Garai, Carlos Garnacho, Sebastian Keller, Jeffrey Knockel,
Robert Mader, Florian Müllner, Georges Basile Stavracas Neto, Corentin Noël,
Pascal Nowack, Shiki Okasaka, Mart Raudsepp, Keyu Tao,
Marco Trevisan (Treviño), Daniel van Vugt, Sebastian Wick, Philip Withnall
Translators:
Hugo Carvalho [pt], Leônidas Araújo [pt_BR]
Hugo Carvalho [pt], Leônidas Araújo [pt_BR], Scrambled 777 [hi],
Jose Riha [sk], Милош Поповић [sr]
46.1
====
...
...
README.md
View file @
faa99c8d
...
...
@@ -48,6 +48,11 @@ documentation and API references below first.
-
CoglPango:
<https://mutter.gnome.org/cogl-pango/>
-
Mtk:
<https://mutter.gnome.org/mtk/>
## Meetings
There are
[
recurring meetings
](
https://hedgedoc.gnome.org/s/ymP_L5MUs
)
to
discuss development of GNOME Shell, mutter and related components.
## License
Mutter is distributed under the terms of the GNU General Public License,
...
...
clutter/clutter/cally/cally-actor.c
View file @
faa99c8d
...
...
@@ -78,31 +78,6 @@
#include
"cally/cally-actor.h"
#include
"cally/cally-actor-private.h"
typedef
struct
_CallyActorActionInfo
CallyActorActionInfo
;
/*< private >
* CallyActorActionInfo:
* @name: name of the action
* @description: description of the action
* @keybinding: keybinding related to the action
* @do_action_func: callback
* @user_data: data to be passed to @do_action_func
* @notify: function to be called when removing the action
*
* Utility structure to maintain the different actions added to the
* #CallyActor
*/
struct
_CallyActorActionInfo
{
gchar
*
name
;
gchar
*
description
;
gchar
*
keybinding
;
CallyActionCallback
do_action_func
;
gpointer
user_data
;
GDestroyNotify
notify
;
};
static
void
cally_actor_initialize
(
AtkObject
*
obj
,
gpointer
data
);
static
void
cally_actor_finalize
(
GObject
*
obj
);
...
...
@@ -123,12 +98,6 @@ static gint cally_actor_add_actor (ClutterActor *container,
static
gint
cally_actor_remove_actor
(
ClutterActor
*
container
,
ClutterActor
*
actor
,
gpointer
data
);
static
gint
cally_actor_real_add_actor
(
ClutterActor
*
container
,
ClutterActor
*
actor
,
gpointer
data
);
static
gint
cally_actor_real_remove_actor
(
ClutterActor
*
container
,
ClutterActor
*
actor
,
gpointer
data
);
/* AtkComponent.h */
static
void
cally_actor_component_interface_init
(
AtkComponentIface
*
iface
);
...
...
@@ -141,27 +110,6 @@ static void cally_actor_get_extents (AtkComponent *component,
static
gint
cally_actor_get_mdi_zorder
(
AtkComponent
*
component
);
static
gboolean
cally_actor_grab_focus
(
AtkComponent
*
component
);
/* AtkAction.h */
static
void
cally_actor_action_interface_init
(
AtkActionIface
*
iface
);
static
gboolean
cally_actor_action_do_action
(
AtkAction
*
action
,
gint
i
);
static
gboolean
idle_do_action
(
gpointer
data
);
static
gint
cally_actor_action_get_n_actions
(
AtkAction
*
action
);
static
const
gchar
*
cally_actor_action_get_description
(
AtkAction
*
action
,
gint
i
);
static
const
gchar
*
cally_actor_action_get_keybinding
(
AtkAction
*
action
,
gint
i
);
static
const
gchar
*
cally_actor_action_get_name
(
AtkAction
*
action
,
gint
i
);
static
gboolean
cally_actor_action_set_description
(
AtkAction
*
action
,
gint
i
,
const
gchar
*
desc
);
static
void
_cally_actor_destroy_action_info
(
gpointer
action_info
,
gpointer
user_data
);
static
void
_cally_actor_clean_action_list
(
CallyActor
*
cally_actor
);
static
CallyActorActionInfo
*
_cally_actor_get_action_info
(
CallyActor
*
cally_actor
,
gint
index
);
/* Misc functions */
static
void
cally_actor_notify_clutter
(
GObject
*
obj
,
GParamSpec
*
pspec
);
...
...
@@ -170,10 +118,6 @@ static void cally_actor_real_notify_clutter (GObject *obj,
struct
_CallyActorPrivate
{
GQueue
*
action_queue
;
guint
action_idle_handler
;
GList
*
action_list
;
GList
*
children
;
};
...
...
@@ -182,9 +126,7 @@ G_DEFINE_TYPE_WITH_CODE (CallyActor,
ATK_TYPE_GOBJECT_ACCESSIBLE
,
G_ADD_PRIVATE
(
CallyActor
)
G_IMPLEMENT_INTERFACE
(
ATK_TYPE_COMPONENT
,
cally_actor_component_interface_init
)
G_IMPLEMENT_INTERFACE
(
ATK_TYPE_ACTION
,
cally_actor_action_interface_init
));
cally_actor_component_interface_init
));
/**
* cally_actor_new:
...
...
@@ -263,8 +205,6 @@ cally_actor_class_init (CallyActorClass *klass)
GObjectClass
*
gobject_class
=
G_OBJECT_CLASS
(
klass
);
klass
->
notify_clutter
=
cally_actor_real_notify_clutter
;
klass
->
add_actor
=
cally_actor_real_add_actor
;
klass
->
remove_actor
=
cally_actor_real_remove_actor
;
/* GObject */
gobject_class
->
finalize
=
cally_actor_finalize
;
...
...
@@ -283,12 +223,6 @@ static void
cally_actor_init
(
CallyActor
*
cally_actor
)
{
CallyActorPrivate
*
priv
=
cally_actor_get_instance_private
(
cally_actor
);
priv
->
action_queue
=
NULL
;
priv
->
action_idle_handler
=
0
;
priv
->
action_list
=
NULL
;
priv
->
children
=
NULL
;
}
...
...
@@ -301,15 +235,6 @@ cally_actor_finalize (GObject *obj)
cally_actor
=
CALLY_ACTOR
(
obj
);
priv
=
cally_actor_get_instance_private
(
cally_actor
);
_cally_actor_clean_action_list
(
cally_actor
);
g_clear_handle_id
(
&
priv
->
action_idle_handler
,
g_source_remove
);
if
(
priv
->
action_queue
)
{
g_queue_free
(
priv
->
action_queue
);
}
if
(
priv
->
children
)
{
g_list_free
(
priv
->
children
);
...
...
@@ -523,43 +448,9 @@ cally_actor_add_actor (ClutterActor *container,
ClutterActor
*
actor
,
gpointer
data
)
{
CallyActor
*
cally_actor
=
CALLY_ACTOR
(
data
);
CallyActorClass
*
klass
=
NULL
;
klass
=
CALLY_ACTOR_GET_CLASS
(
cally_actor
);
if
(
klass
->
add_actor
)
return
klass
->
add_actor
(
container
,
actor
,
data
);
else
return
1
;
}
static
gint
cally_actor_remove_actor
(
ClutterActor
*
container
,
ClutterActor
*
actor
,
gpointer
data
)
{
CallyActor
*
cally_actor
=
CALLY_ACTOR
(
data
);
CallyActorClass
*
klass
=
NULL
;
klass
=
CALLY_ACTOR_GET_CLASS
(
cally_actor
);
if
(
klass
->
remove_actor
)
return
klass
->
remove_actor
(
container
,
actor
,
data
);
else
return
1
;
}
static
gint
cally_actor_real_add_actor
(
ClutterActor
*
container
,
ClutterActor
*
actor
,
gpointer
data
)
{
AtkObject
*
atk_parent
=
ATK_OBJECT
(
data
);
AtkObject
*
atk_parent
=
clutter_actor_get_accessible
(
container
);
AtkObject
*
atk_child
=
clutter_actor_get_accessible
(
actor
);
CallyActor
*
cally_actor
=
CALLY_ACTOR
(
atk_parent
);
CallyActorPrivate
*
priv
=
cally_actor_get_instance_private
(
cally_actor
);
CallyActorPrivate
*
priv
=
cally_actor_get_instance_private
(
CALLY_ACTOR
(
atk_parent
));
gint
index
;
g_return_val_if_fail
(
CLUTTER_IS_ACTOR
(
container
),
0
);
...
...
@@ -579,34 +470,35 @@ cally_actor_real_add_actor (ClutterActor *container,
}
static
gint
cally_actor_
real_
remove_actor
(
ClutterActor
*
container
,
cally_actor_remove_actor
(
ClutterActor
*
container
,
ClutterActor
*
actor
,
gpointer
data
)
{
g_autoptr
(
AtkObject
)
atk_child
=
NULL
;
AtkPropertyValues
values
=
{
NULL
};
AtkObject
*
atk_parent
=
NULL
;
AtkObject
*
atk_child
=
NULL
;
CallyActorPrivate
*
priv
=
NULL
;
gint
index
;
g_return_val_if_fail
(
CLUTTER_IS_ACTOR
(
container
),
0
);
g_return_val_if_fail
(
CLUTTER_IS_ACTOR
(
actor
),
0
);
atk_parent
=
ATK_OBJECT
(
data
);
atk_parent
=
clutter_actor_get_accessible
(
container
);
if
(
clutter_actor_has_accessible
(
actor
))
{
atk_child
=
clutter_actor_get_accessible
(
actor
);
g_assert
(
ATK_IS_OBJECT
(
atk_child
));
g_object_ref
(
atk_child
);
g_value_init
(
&
values
.
old_value
,
G_TYPE_POINTER
);
g_value_set_pointer
(
&
values
.
old_value
,
atk_parent
);
values
.
property_name
=
"accessible-parent"
;
g_object_ref
(
atk_child
);
g_signal_emit_by_name
(
atk_child
,
"property_change::accessible-parent"
,
&
values
,
NULL
);
g_object_unref
(
atk_child
);
}
priv
=
cally_actor_get_instance_private
(
CALLY_ACTOR
(
atk_parent
));
...
...
@@ -666,10 +558,10 @@ cally_actor_get_extents (AtkComponent *component,
clutter_actor_get_abs_allocation_vertices
(
actor
,
verts
);
clutter_actor_get_transformed_size
(
actor
,
&
f_width
,
&
f_height
);
*
x
=
verts
[
0
].
x
;
*
y
=
verts
[
0
].
y
;
*
width
=
ceilf
(
f_width
);
*
height
=
ceilf
(
f_height
);
*
x
=
(
int
)
verts
[
0
].
x
;
*
y
=
(
int
)
verts
[
0
].
y
;
*
width
=
(
int
)
ceilf
(
f_width
);
*
height
=
(
int
)
ceilf
(
f_height
);
}
static
gint
...
...
@@ -683,7 +575,7 @@ cally_actor_get_mdi_zorder (AtkComponent *component)
cally_actor
=
CALLY_ACTOR
(
component
);
actor
=
CALLY_GET_CLUTTER_ACTOR
(
cally_actor
);
return
clutter_actor_get_z_position
(
actor
);
return
(
int
)
clutter_actor_get_z_position
(
actor
);
}
static
gboolean
...
...
@@ -706,179 +598,6 @@ cally_actor_grab_focus (AtkComponent *component)
return
TRUE
;
}
/* AtkAction implementation */
static
void
cally_actor_action_interface_init
(
AtkActionIface
*
iface
)
{
g_return_if_fail
(
iface
!=
NULL
);
iface
->
do_action
=
cally_actor_action_do_action
;
iface
->
get_n_actions
=
cally_actor_action_get_n_actions
;
iface
->
get_description
=
cally_actor_action_get_description
;
iface
->
get_keybinding
=
cally_actor_action_get_keybinding
;
iface
->
get_name
=
cally_actor_action_get_name
;
iface
->
set_description
=
cally_actor_action_set_description
;
}
static
gboolean
cally_actor_action_do_action
(
AtkAction
*
action
,
gint
index
)
{
CallyActor
*
cally_actor
=
NULL
;
AtkStateSet
*
set
=
NULL
;
CallyActorPrivate
*
priv
=
NULL
;
CallyActorActionInfo
*
info
=
NULL
;
gboolean
did_action
=
FALSE
;
cally_actor
=
CALLY_ACTOR
(
action
);
priv
=
cally_actor_get_instance_private
(
cally_actor
);
set
=
atk_object_ref_state_set
(
ATK_OBJECT
(
cally_actor
));
if
(
atk_state_set_contains_state
(
set
,
ATK_STATE_DEFUNCT
))
goto
out
;
if
(
!
atk_state_set_contains_state
(
set
,
ATK_STATE_SENSITIVE
)
||
!
atk_state_set_contains_state
(
set
,
ATK_STATE_SHOWING
))
goto
out
;
info
=
_cally_actor_get_action_info
(
cally_actor
,
index
);
if
(
info
==
NULL
)
goto
out
;
if
(
info
->
do_action_func
==
NULL
)
goto
out
;
if
(
!
priv
->
action_queue
)
priv
->
action_queue
=
g_queue_new
();
g_queue_push_head
(
priv
->
action_queue
,
info
);
if
(
!
priv
->
action_idle_handler
)
priv
->
action_idle_handler
=
g_idle_add
(
idle_do_action
,
cally_actor
);
did_action
=
TRUE
;
out:
g_clear_object
(
&
set
);
return
did_action
;
}
static
gboolean
idle_do_action
(
gpointer
data
)
{
CallyActor
*
cally_actor
=
NULL
;
CallyActorPrivate
*
priv
=
NULL
;
ClutterActor
*
actor
=
NULL
;
cally_actor
=
CALLY_ACTOR
(
data
);
priv
=
cally_actor_get_instance_private
(
cally_actor
);
actor
=
CALLY_GET_CLUTTER_ACTOR
(
cally_actor
);
priv
->
action_idle_handler
=
0
;
if
(
actor
==
NULL
)
/* state is defunct*/
return
FALSE
;
while
(
!
g_queue_is_empty
(
priv
->
action_queue
))
{
CallyActorActionInfo
*
info
=
NULL
;
info
=
(
CallyActorActionInfo
*
)
g_queue_pop_head
(
priv
->
action_queue
);
info
->
do_action_func
(
cally_actor
,
info
->
user_data
);
}
return
FALSE
;
}
static
gint
cally_actor_action_get_n_actions
(
AtkAction
*
action
)
{
CallyActor
*
cally_actor
=
NULL
;
CallyActorPrivate
*
priv
=
NULL
;
g_return_val_if_fail
(
CALLY_IS_ACTOR
(
action
),
0
);
cally_actor
=
CALLY_ACTOR
(
action
);
priv
=
cally_actor_get_instance_private
(
cally_actor
);
return
g_list_length
(
priv
->
action_list
);
}
static
const
gchar
*
cally_actor_action_get_name
(
AtkAction
*
action
,
gint
i
)
{
CallyActor
*
cally_actor
=
NULL
;
CallyActorActionInfo
*
info
=
NULL
;
g_return_val_if_fail
(
CALLY_IS_ACTOR
(
action
),
NULL
);
cally_actor
=
CALLY_ACTOR
(
action
);
info
=
_cally_actor_get_action_info
(
cally_actor
,
i
);
if
(
info
==
NULL
)
return
NULL
;
return
info
->
name
;
}
static
const
gchar
*
cally_actor_action_get_description
(
AtkAction
*
action
,
gint
i
)
{
CallyActor
*
cally_actor
=
NULL
;
CallyActorActionInfo
*
info
=
NULL
;
g_return_val_if_fail
(
CALLY_IS_ACTOR
(
action
),
NULL
);
cally_actor
=
CALLY_ACTOR
(
action
);
info
=
_cally_actor_get_action_info
(
cally_actor
,
i
);
if
(
info
==
NULL
)
return
NULL
;
return
info
->
description
;
}
static
gboolean
cally_actor_action_set_description
(
AtkAction
*
action
,
gint
i
,
const
gchar
*
desc
)
{
CallyActor
*
cally_actor
=
NULL
;
CallyActorActionInfo
*
info
=
NULL
;
g_return_val_if_fail
(
CALLY_IS_ACTOR
(
action
),
FALSE
);
cally_actor
=
CALLY_ACTOR
(
action
);
info
=
_cally_actor_get_action_info
(
cally_actor
,
i
);
if
(
info
==
NULL
)
return
FALSE
;
g_free
(
info
->
description
);
info
->
description
=
g_strdup
(
desc
);
return
TRUE
;
}
static
const
gchar
*
cally_actor_action_get_keybinding
(
AtkAction
*
action
,
gint
i
)
{
CallyActor
*
cally_actor
=
NULL
;
CallyActorActionInfo
*
info
=
NULL
;
g_return_val_if_fail
(
CALLY_IS_ACTOR
(
action
),
NULL
);
cally_actor
=
CALLY_ACTOR
(
action
);
info
=
_cally_actor_get_action_info
(
cally_actor
,
i
);
if
(
info
==
NULL
)
return
NULL
;
return
info
->
keybinding
;
}
/* Misc functions */
/*
...
...
@@ -945,202 +664,3 @@ cally_actor_real_notify_clutter (GObject *obj,
atk_object_notify_state_change
(
atk_obj
,
state
,
value
);
}
static
void
_cally_actor_clean_action_list
(
CallyActor
*
cally_actor
)
{
CallyActorPrivate
*
priv
=
NULL
;
priv
=
cally_actor_get_instance_private
(
cally_actor
);
if
(
priv
->
action_list
)
{
g_list_free_full
(
priv
->
action_list
,
(
GDestroyNotify
)
_cally_actor_destroy_action_info
);
priv
->
action_list
=
NULL
;
}
}
static
CallyActorActionInfo
*
_cally_actor_get_action_info
(
CallyActor
*
cally_actor
,
gint
index
)
{
CallyActorPrivate
*
priv
=
NULL
;
GList
*
node
=
NULL
;
g_return_val_if_fail
(
CALLY_IS_ACTOR
(
cally_actor
),
NULL
);
priv
=
cally_actor_get_instance_private
(
cally_actor
);
if
(
priv
->
action_list
==
NULL
)
return
NULL
;
node
=
g_list_nth
(
priv
->
action_list
,
index
);
if
(
node
==
NULL
)
return
NULL
;
return
(
CallyActorActionInfo
*
)(
node
->
data
);
}
/**
* cally_actor_add_action: (skip)
* @cally_actor: a #CallyActor
* @action_name: the action name
* @action_description: the action description
* @action_keybinding: the action keybinding
* @action_func: the callback of the action, to be executed with do_action
*
* Adds a new action to be accessed with the #AtkAction interface.
*
* Return value: added action id, or -1 if failure
*/
guint
cally_actor_add_action
(
CallyActor
*
cally_actor
,
const
gchar
*
action_name
,
const
gchar
*
action_description
,
const
gchar
*
action_keybinding
,
CallyActionFunc
action_func
)
{
return
cally_actor_add_action_full
(
cally_actor
,
action_name
,
action_description
,
action_keybinding
,
(
CallyActionCallback
)
action_func
,
NULL
,
NULL
);
}
/**
* cally_actor_add_action_full: (rename-to cally_actor_add_action)
* @cally_actor: a #CallyActor
* @action_name: the action name
* @action_description: the action description
* @action_keybinding: the action keybinding
* @callback: (scope notified): the callback of the action
* @user_data: (closure): data to be passed to @callback
* @notify: function to be called when removing the action
*
* Adds a new action to be accessed with the #AtkAction interface.
*
* Return value: added action id, or -1 if failure
*/
guint
cally_actor_add_action_full
(
CallyActor
*
cally_actor
,
const
gchar
*
action_name
,
const
gchar
*
action_description
,
const
gchar
*
action_keybinding
,
CallyActionCallback
callback
,
gpointer
user_data
,
GDestroyNotify
notify
)
{
CallyActorActionInfo
*
info
=
NULL
;
CallyActorPrivate
*
priv
=
NULL
;
g_return_val_if_fail
(
CALLY_IS_ACTOR
(
cally_actor
),
-
1
);
g_return_val_if_fail
(
callback
!=
NULL
,
-
1
);
priv
=
cally_actor_get_instance_private
(
cally_actor
);
info
=
g_new0
(
CallyActorActionInfo
,
1
);
info
->
name
=
g_strdup
(
action_name
);
info
->
description
=
g_strdup
(
action_description
);
info
->
keybinding
=
g_strdup
(
action_keybinding
);
info
->
do_action_func
=
callback
;
info
->
user_data
=
user_data
;
info
->
notify
=
notify
;
priv
->
action_list
=
g_list_append
(
priv
->
action_list
,
info
);
return
g_list_length
(
priv
->
action_list
);
}
/**
* cally_actor_remove_action:
* @cally_actor: a #CallyActor
* @action_id: the action id
*
* Removes a action, using the @action_id returned by [method@Actor.add_action]
*
* Return value: %TRUE if the operation was successful, %FALSE otherwise
*/
gboolean
cally_actor_remove_action
(
CallyActor
*
cally_actor
,
gint
action_id
)
{
GList
*
list_node
=
NULL
;
CallyActorPrivate
*
priv
=
NULL
;
g_return_val_if_fail
(
CALLY_IS_ACTOR
(
cally_actor
),
FALSE
);
priv
=
cally_actor_get_instance_private
(
cally_actor
);
list_node
=
g_list_nth
(
priv
->
action_list
,
action_id
-
1
);
if
(
!
list_node
)
return
FALSE
;
_cally_actor_destroy_action_info
(
list_node
->
data
,
NULL
);
priv
->
action_list
=
g_list_remove_link
(
priv
->
action_list
,
list_node
);
return
TRUE
;
}
/**
* cally_actor_remove_action_by_name:
* @cally_actor: a #CallyActor
* @action_name: the name of the action to remove
*
* Removes an action, using the @action_name used when the action was added
* with [method@Actor.add_action]
*
* Return value: %TRUE if the operation was successful, %FALSE otherwise
*/
gboolean
cally_actor_remove_action_by_name
(
CallyActor
*
cally_actor
,
const
gchar
*
action_name
)
{
GList
*
node
=
NULL
;
gboolean
action_found
=
FALSE
;
CallyActorPrivate
*
priv
=
NULL
;
g_return_val_if_fail
(
CALLY_IS_ACTOR
(
cally_actor
),
FALSE
);
priv
=
cally_actor_get_instance_private
(
cally_actor
);
for
(
node
=
priv
->
action_list
;
node
&&
!
action_found
;
node
=
node
->
next
)
{
CallyActorActionInfo
*
ainfo
=
node
->
data
;
if
(
!
g_ascii_strcasecmp
(
ainfo
->
name
,
action_name
))
{
action_found
=
TRUE
;
break
;
}
}
if
(
!
action_found
)
return
FALSE
;
_cally_actor_destroy_action_info
(
node
->
data
,
NULL
);
priv
->
action_list
=
g_list_remove_link
(
priv
->
action_list
,
node
);
return
TRUE
;
}
static
void
_cally_actor_destroy_action_info
(
gpointer
action_info
,
gpointer
user_data
)
{
CallyActorActionInfo
*
info
=
action_info
;
g_assert
(
info
!=
NULL
);
g_free
(
info
->
name
);
g_free
(
info
->
description
);
g_free
(
info
->
keybinding
);
if
(
info
->
notify
)
info
->
notify
(
info
->
user_data
);
g_free
(
info
);
}
clutter/clutter/cally/cally-actor.h
View file @
faa99c8d
...
...
@@ -47,34 +47,10 @@ typedef struct _CallyActor CallyActor;
typedef
struct
_CallyActorClass
CallyActorClass
;
typedef
struct
_CallyActorPrivate
CallyActorPrivate
;
/**
* CallyActionFunc:
* @cally_actor: a #CallyActor
*
* Action function, to be used on #AtkAction implementations as a individual
* action
*/
typedef
void
(
*
CallyActionFunc
)
(
CallyActor
*
cally_actor
);
/**
* CallyActionCallback:
* @cally_actor: a #CallyActor
* @user_data: user data passed to the function
*
* Action function, to be used on #AtkAction implementations as
* an individual action.
*
* Unlike #CallyActionFunc, this function uses the @user_data
* argument passed to [method@Actor.add_action_full].
*/
typedef
void
(
*
CallyActionCallback
)
(
CallyActor
*
cally_actor
,
gpointer
user_data
);
/**
* CallyActorClass:
* @notify_clutter: Signal handler for notify signal on Clutter actor
* @add_actor: Signal handler for child-added signal on Clutter actor
* @remove_actor: Signal handler for child-removed signal on Clutter actor
*/
struct
_CallyActorClass
{
...
...
@@ -84,40 +60,10 @@ struct _CallyActorClass
/*< public >*/
void
(
*
notify_clutter
)
(
GObject
*
object
,
GParamSpec
*
pspec
);
gint
(
*
add_actor
)
(
ClutterActor
*
container
,
ClutterActor
*
actor
,
gpointer
data
);
gint
(
*
remove_actor
)
(
ClutterActor
*
container
,
ClutterActor
*
actor
,
gpointer
data
);
};
CLUTTER_EXPORT
AtkObject
*
cally_actor_new
(
ClutterActor
*
actor
);
CLUTTER_EXPORT
guint
cally_actor_add_action
(
CallyActor
*
cally_actor
,
const
gchar
*
action_name
,
const
gchar
*
action_description
,
const
gchar
*
action_keybinding
,
CallyActionFunc
action_func
);
CLUTTER_EXPORT
guint
cally_actor_add_action_full
(
CallyActor
*
cally_actor
,
const
gchar
*
action_name
,
const
gchar
*
action_description
,
const
gchar
*
action_keybinding
,
CallyActionCallback
callback
,
gpointer
user_data
,
GDestroyNotify
notify
);
CLUTTER_EXPORT
gboolean
cally_actor_remove_action
(
CallyActor
*
cally_actor
,
gint
action_id
);
CLUTTER_EXPORT
gboolean
cally_actor_remove_action_by_name
(
CallyActor
*
cally_actor
,
const
gchar
*
action_name
);
G_END_DECLS
clutter/clutter/cally/cally-text.c
View file @
faa99c8d
...
...
@@ -40,7 +40,6 @@
#include
"cally/cally-text.h"
#include
"cally/cally-actor-private.h"
#include
"clutter/clutter-color.h"
#include
"clutter/clutter-main.h"
#include
"clutter/clutter-text.h"
...
...
@@ -168,6 +167,42 @@ static int _cally_misc_get_index_at_point (ClutterText *clutter
gint
y
,
AtkCoordType
coords
);
/* AtkAction.h */
static
void
cally_text_action_interface_init
(
AtkActionIface
*
iface
);
static
gboolean
cally_text_action_do_action
(
AtkAction
*
action
,
gint
i
);
static
gint
cally_text_action_get_n_actions
(
AtkAction
*
action
);
static
const
gchar
*
cally_text_action_get_name
(
AtkAction
*
action
,
gint
i
);
/**
* CallyActionFunc:
* @cally_actor: a #CallyActor
*
* Action function, to be used on #AtkAction implementations as a individual
* action
*/
typedef
void
(
*
CallyActionFunc
)
(
CallyActor
*
cally_actor
);
/*< private >
* CallyTextActionInfo:
* @name: name of the action
* @do_action_func: callback
*
* Utility structure to maintain the different actions added to the
* #CallyActor
*/
typedef
struct
_CallyTextActionInfo
{
gchar
*
name
;
CallyActionFunc
do_action_func
;
}
CallyTextActionInfo
;
typedef
struct
_CallyTextPrivate
{
/* Cached ClutterText values*/
...
...
@@ -186,7 +221,9 @@ typedef struct _CallyTextPrivate
gint
length_delete
;
/* action */
guint
activate_action_id
;
CallyTextActionInfo
*
activate_action
;
GQueue
*
action_queue
;
guint
action_idle_handler
;
}
CallyTextPrivate
;
G_DEFINE_TYPE_WITH_CODE
(
CallyText
,
...
...
@@ -195,6 +232,8 @@ G_DEFINE_TYPE_WITH_CODE (CallyText,
G_ADD_PRIVATE
(
CallyText
)
G_IMPLEMENT_INTERFACE
(
ATK_TYPE_TEXT
,
cally_text_text_interface_init
)
G_IMPLEMENT_INTERFACE
(
ATK_TYPE_ACTION
,
cally_text_action_interface_init
)
G_IMPLEMENT_INTERFACE
(
ATK_TYPE_EDITABLE_TEXT
,
cally_text_editable_text_interface_init
));
...
...
@@ -229,8 +268,7 @@ cally_text_init (CallyText *cally_text)
priv
->
signal_name_delete
=
NULL
;
priv
->
position_delete
=
-
1
;
priv
->
length_delete
=
-
1
;
priv
->
activate_action_id
=
0
;
priv
->
action_queue
=
g_queue_new
();
}
static
void
...
...
@@ -240,10 +278,9 @@ cally_text_finalize (GObject *obj)
CallyTextPrivate
*
priv
=
cally_text_get_instance_private
(
cally_text
);
/* g_object_unref (priv->textutil); */
/* priv->textutil = NULL; */
g_clear_handle_id
(
&
priv
->
insert_idle_handler
,
g_source_remove
);
g_clear_handle_id
(
&
priv
->
action_idle_handler
,
g_source_remove
);
g_clear_pointer
(
&
priv
->
action_queue
,
g_queue_free
);
G_OBJECT_CLASS
(
cally_text_parent_class
)
->
finalize
(
obj
);
}
...
...
@@ -1460,8 +1497,8 @@ static void cally_text_get_character_extents (AtkText *text,
}
clutter_actor_get_abs_allocation_vertices
(
actor
,
verts
);
x_window
=
verts
[
0
].
x
;
y_window
=
verts
[
0
].
y
;
x_window
=
(
int
)
verts
[
0
].
x
;
y_window
=
(
int
)
verts
[
0
].
y
;
clutter_text_get_layout_offsets
(
clutter_text
,
&
x_layout
,
&
y_layout
);
...
...
@@ -1827,24 +1864,119 @@ _check_activate_action (CallyText *cally_text,
cally_text_get_instance_private
(
cally_text
);
if
(
clutter_text_get_activatable
(
clutter_text
))
{
if
(
priv
->
activate_action
_id
!=
0
)
if
(
priv
->
activate_action
!=
NULL
)
return
;
priv
->
activate_action
_id
=
cally_actor_add_action
(
CALLY_ACTOR
(
c
ally
_t
ext
),
"activate"
,
NULL
,
NULL
,
_cally_text_activate_action
)
;
priv
->
activate_action
=
g_new0
(
C
ally
T
ext
ActionInfo
,
1
);
priv
->
activate_action
->
name
=
g_strdup
(
"activate"
);
priv
->
activate_action
->
do_action_func
=
_cally_text_activate_action
;
}
else
{
if
(
priv
->
activate_action
_id
==
0
)
if
(
priv
->
activate_action
==
NULL
)
return
;
if
(
cally_actor_remove_action
(
CALLY_ACTOR
(
cally_text
),
priv
->
activate_action_id
))
g_clear_pointer
(
&
priv
->
activate_action
->
name
,
g_free
);
g_clear_pointer
(
&
priv
->
activate_action
,
g_free
);
}
}
/* AtkAction implementation */
static
void
cally_text_action_interface_init
(
AtkActionIface
*
iface
)
{
priv
->
activate_action_id
=
0
;
iface
->
do_action
=
cally_text_action_do_action
;
iface
->
get_n_actions
=
cally_text_action_get_n_actions
;
iface
->
get_name
=
cally_text_action_get_name
;
}
static
gboolean
idle_do_action
(
gpointer
data
)
{
CallyActor
*
cally_actor
=
NULL
;
CallyTextPrivate
*
priv
=
NULL
;
cally_actor
=
CALLY_ACTOR
(
data
);
priv
=
cally_text_get_instance_private
(
CALLY_TEXT
(
cally_actor
));
priv
->
action_idle_handler
=
0
;
/* state is defunct*/
g_assert
(
CALLY_GET_CLUTTER_ACTOR
(
cally_actor
)
!=
NULL
);
while
(
!
g_queue_is_empty
(
priv
->
action_queue
))
{
CallyTextActionInfo
*
info
=
NULL
;
info
=
(
CallyTextActionInfo
*
)
g_queue_pop_head
(
priv
->
action_queue
);
info
->
do_action_func
(
cally_actor
);
}
return
FALSE
;
}
static
gboolean
cally_text_action_do_action
(
AtkAction
*
action
,
gint
index
)
{
g_autoptr
(
AtkStateSet
)
set
=
NULL
;
CallyText
*
cally_actor
;
CallyTextPrivate
*
priv
;
/* Only activate action is supported*/
g_return_val_if_fail
(
index
!=
0
,
FALSE
);
g_return_val_if_fail
(
CALLY_IS_TEXT
(
action
),
FALSE
);
cally_actor
=
CALLY_TEXT
(
action
);
priv
=
cally_text_get_instance_private
(
cally_actor
);
set
=
atk_object_ref_state_set
(
ATK_OBJECT
(
cally_actor
));
if
(
atk_state_set_contains_state
(
set
,
ATK_STATE_DEFUNCT
))
return
FALSE
;
if
(
!
atk_state_set_contains_state
(
set
,
ATK_STATE_SENSITIVE
)
||
!
atk_state_set_contains_state
(
set
,
ATK_STATE_SHOWING
))
return
FALSE
;
if
(
priv
->
activate_action
==
NULL
)
return
FALSE
;
if
(
priv
->
activate_action
->
do_action_func
==
NULL
)
return
FALSE
;
g_queue_push_head
(
priv
->
action_queue
,
priv
->
activate_action
);
if
(
!
priv
->
action_idle_handler
)
priv
->
action_idle_handler
=
g_idle_add
(
idle_do_action
,
cally_actor
);
return
TRUE
;
}
static
gint
cally_text_action_get_n_actions
(
AtkAction
*
action
)
{
g_return_val_if_fail
(
CALLY_IS_ACTOR
(
action
),
0
);
/* We only support activate action*/
return
1
;
}
static
const
gchar
*
cally_text_action_get_name
(
AtkAction
*
action
,
gint
i
)
{
CallyTextPrivate
*
priv
;
g_return_val_if_fail
(
CALLY_IS_ACTOR
(
action
),
NULL
);
priv
=
cally_text_get_instance_private
(
CALLY_TEXT
(
action
));
if
(
priv
->
activate_action
==
NULL
)
return
NULL
;
return
priv
->
activate_action
->
name
;
}
/* GailTextUtil/GailMisc reimplementation methods */
...
...
@@ -2024,7 +2156,7 @@ static AtkAttributeSet*
_cally_misc_add_actor_color_to_attribute_set
(
AtkAttributeSet
*
attrib_set
,
ClutterText
*
clutter_text
)
{
C
lutter
Color
color
;
C
ogl
Color
color
;
gchar
*
value
;
clutter_text_get_color
(
clutter_text
,
&
color
);
...
...
@@ -2306,8 +2438,8 @@ _cally_misc_get_index_at_point (ClutterText *clutter_text,
clutter_text_get_layout_offsets
(
clutter_text
,
&
x_layout
,
&
y_layout
);
clutter_actor_get_abs_allocation_vertices
(
CLUTTER_ACTOR
(
clutter_text
),
verts
);
x_window
=
verts
[
0
].
x
;
y_window
=
verts
[
0
].
y
;
x_window
=
(
int
)
verts
[
0
].
x
;
y_window
=
(
int
)
verts
[
0
].
y
;
x_temp
=
x
-
x_layout
-
x_window
;
y_temp
=
y
-
y_layout
-
y_window
;
...
...
clutter/clutter/clutter-actor-box.c
View file @
faa99c8d
...
...
@@ -393,10 +393,10 @@ clutter_actor_box_interpolate (const ClutterActorBox *initial,
g_return_if_fail
(
final
!=
NULL
);
g_return_if_fail
(
result
!=
NULL
);
result
->
x1
=
initial
->
x1
+
(
final
->
x1
-
initial
->
x1
)
*
progress
;
result
->
y1
=
initial
->
y1
+
(
final
->
y1
-
initial
->
y1
)
*
progress
;
result
->
x2
=
initial
->
x2
+
(
final
->
x2
-
initial
->
x2
)
*
progress
;
result
->
y2
=
initial
->
y2
+
(
final
->
y2
-
initial
->
y2
)
*
progress
;
result
->
x1
=
(
float
)
(
initial
->
x1
+
(
final
->
x1
-
initial
->
x1
)
*
progress
)
;
result
->
y1
=
(
float
)
(
initial
->
y1
+
(
final
->
y1
-
initial
->
y1
)
*
progress
)
;
result
->
x2
=
(
float
)
(
initial
->
x2
+
(
final
->
x2
-
initial
->
x2
)
*
progress
)
;
result
->
y2
=
(
float
)
(
initial
->
y2
+
(
final
->
y2
-
initial
->
y2
)
*
progress
)
;
}
/**
...
...
@@ -539,8 +539,8 @@ _clutter_actor_box_enlarge_for_effects (ClutterActorBox *box)
* here is 1.75px in total if you consider that the 0.75 padding could
* just cross an integer boundary and so ceil will effectively add 1.
*/
box
->
x2
=
ceilf
(
box
->
x2
+
0
.
75
);
box
->
y2
=
ceilf
(
box
->
y2
+
0
.
75
);
box
->
x2
=
ceilf
(
box
->
x2
+
0
.
75
f
);
box
->
y2
=
ceilf
(
box
->
y2
+
0
.
75
f
);
/* Now we redefine the top-left relative to the bottom right based on the
* rounded width/height determined above + a constant so that the overall
...
...
clutter/clutter/clutter-actor.c
View file @
faa99c8d
This diff is collapsed.
Click to expand it.
clutter/clutter/clutter-actor.h
View file @
faa99c8d
...
...
@@ -222,7 +222,8 @@ struct _ClutterActorClass
gboolean
(
*
has_overlaps
)
(
ClutterActor
*
self
);
void
(
*
paint_node
)
(
ClutterActor
*
self
,
ClutterPaintNode
*
root
);
ClutterPaintNode
*
root
,
ClutterPaintContext
*
paint_context
);
gboolean
(
*
touch_event
)
(
ClutterActor
*
self
,
ClutterEvent
*
event
);
...
...
@@ -564,6 +565,10 @@ ClutterContentRepeat clutter_actor_get_content_repeat
CLUTTER_EXPORT
void
clutter_actor_set_color_state
(
ClutterActor
*
self
,
ClutterColorState
*
color_state
);
CLUTTER_EXPORT
void
clutter_actor_unset_color_state
(
ClutterActor
*
self
);
CLUTTER_EXPORT
ClutterColorState
*
clutter_actor_get_color_state
(
ClutterActor
*
self
);
...
...
@@ -572,10 +577,10 @@ void clutter_actor_get_content_box
ClutterActorBox
*
box
);
CLUTTER_EXPORT
void
clutter_actor_set_background_color
(
ClutterActor
*
self
,
const
C
lutter
Color
*
color
);
const
C
ogl
Color
*
color
);
CLUTTER_EXPORT
void
clutter_actor_get_background_color
(
ClutterActor
*
self
,
C
lutter
Color
*
color
);
C
ogl
Color
*
color
);
CLUTTER_EXPORT
const
ClutterPaintVolume
*
clutter_actor_get_paint_volume
(
ClutterActor
*
self
);
CLUTTER_EXPORT
...
...
@@ -662,6 +667,10 @@ gboolean clutter_actor_contains
ClutterActor
*
descendant
);
CLUTTER_EXPORT
ClutterActor
*
clutter_actor_get_stage
(
ClutterActor
*
actor
);
CLUTTER_EXPORT
ClutterContext
*
clutter_actor_get_context
(
ClutterActor
*
actor
);
CLUTTER_EXPORT
void
clutter_actor_set_child_below_sibling
(
ClutterActor
*
self
,
ClutterActor
*
child
,
...
...
clutter/clutter/clutter-align-constraint.c
View file @
faa99c8d
...
...
@@ -582,7 +582,7 @@ clutter_align_constraint_set_factor (ClutterAlignConstraint *align,
{
g_return_if_fail
(
CLUTTER_IS_ALIGN_CONSTRAINT
(
align
));
align
->
factor
=
CLAMP
(
factor
,
0
.
0
,
1
.
0
);
align
->
factor
=
CLAMP
(
factor
,
0
.
0
f
,
1
.
0
f
);
if
(
align
->
actor
!=
NULL
)
clutter_actor_queue_relayout
(
align
->
actor
);
...
...
clutter/clutter/clutter-backend-private.h
View file @
faa99c8d
...
...
@@ -69,7 +69,6 @@ struct _ClutterBackendClass
GError
**
error
);
CoglDisplay
*
(
*
get_display
)
(
ClutterBackend
*
backend
,
CoglRenderer
*
renderer
,
CoglSwapChain
*
swap_chain
,
GError
**
error
);
gboolean
(
*
create_context
)
(
ClutterBackend
*
backend
,
GError
**
error
);
...
...
clutter/clutter/clutter-backend.c
View file @
faa99c8d
...
...
@@ -52,8 +52,6 @@
#include
"cogl/cogl.h"
#define DEFAULT_FONT_NAME "Sans 10"
enum
{
RESOLUTION_CHANGED
,
...
...
@@ -118,12 +116,10 @@ clutter_backend_do_real_create_context (ClutterBackend *backend,
GError
**
error
)
{
ClutterBackendClass
*
klass
;
CoglSwapChain
*
swap_chain
;
klass
=
CLUTTER_BACKEND_GET_CLASS
(
backend
);
swap_chain
=
NULL
;
cogl_init
()
;
klass
=
CLUTTER_BACKEND_GET_CLASS
(
backend
);
CLUTTER_NOTE
(
BACKEND
,
"Creating Cogl renderer"
);
backend
->
cogl_renderer
=
klass
->
get_renderer
(
backend
,
error
);
...
...
@@ -135,15 +131,11 @@ clutter_backend_do_real_create_context (ClutterBackend *backend,
if
(
!
cogl_renderer_connect
(
backend
->
cogl_renderer
,
error
))
goto
error
;
CLUTTER_NOTE
(
BACKEND
,
"Creating Cogl swap chain"
);
swap_chain
=
cogl_swap_chain_new
();
CLUTTER_NOTE
(
BACKEND
,
"Creating Cogl display"
);
if
(
klass
->
get_display
!=
NULL
)
{
backend
->
cogl_display
=
klass
->
get_display
(
backend
,
backend
->
cogl_renderer
,
swap_chain
,
error
);
}
else
...
...
@@ -151,7 +143,7 @@ clutter_backend_do_real_create_context (ClutterBackend *backend,
CoglOnscreenTemplate
*
tmpl
;
gboolean
res
;
tmpl
=
cogl_onscreen_template_new
(
swap_chain
);
tmpl
=
cogl_onscreen_template_new
();
/* XXX: I have some doubts that this is a good design.
*
...
...
@@ -185,7 +177,6 @@ clutter_backend_do_real_create_context (ClutterBackend *backend,
/* the display owns the renderer and the swap chain */
g_object_unref
(
backend
->
cogl_renderer
);
g_object_unref
(
swap_chain
);
return
TRUE
;
...
...
@@ -193,9 +184,6 @@ error:
g_clear_object
(
&
backend
->
cogl_display
);
g_clear_object
(
&
backend
->
cogl_renderer
);
if
(
swap_chain
!=
NULL
)
g_object_unref
(
swap_chain
);
return
FALSE
;
}
...
...
@@ -267,7 +255,7 @@ clutter_backend_real_create_context (ClutterBackend *backend,
return
FALSE
;
}
backend
->
cogl_source
=
cogl_glib_source_new
(
backend
->
cogl_
context
,
G_PRIORITY_DEFAULT
);
backend
->
cogl_source
=
cogl_glib_source_new
(
backend
->
cogl_
renderer
,
G_PRIORITY_DEFAULT
);
g_source_attach
(
backend
->
cogl_source
,
NULL
);
return
TRUE
;
...
...
clutter/clutter/clutter-blur-effect.c
View file @
faa99c8d
...
...
@@ -171,6 +171,8 @@ clutter_blur_effect_init (ClutterBlurEffect *self)
clutter_backend_get_cogl_context
(
clutter_get_default_backend
());
klass
->
base_pipeline
=
cogl_pipeline_new
(
ctx
);
cogl_pipeline_set_static_name
(
klass
->
base_pipeline
,
"ClutterBlurEffect (base pipeline)"
);
snippet
=
cogl_snippet_new
(
COGL_SNIPPET_HOOK_TEXTURE_LOOKUP
,
box_blur_glsl_declarations
,
...
...
clutter/clutter/clutter-blur.c
View file @
faa99c8d
...
...
@@ -150,6 +150,7 @@ create_blur_pipeline (void)
CoglSnippet
*
snippet
;
blur_pipeline
=
cogl_pipeline_new
(
ctx
);
cogl_pipeline_set_static_name
(
blur_pipeline
,
"ClutterBlur"
);
cogl_pipeline_set_layer_null_texture
(
blur_pipeline
,
0
);
cogl_pipeline_set_layer_filters
(
blur_pipeline
,
0
,
...
...
@@ -242,8 +243,8 @@ create_fbo (ClutterBlur *blur,
scaled_height
=
floorf
(
height
/
blur
->
downscale_factor
);
pass
->
texture
=
cogl_texture_2d_new_with_size
(
ctx
,
scaled_width
,
scaled_height
);
(
int
)
scaled_width
,
(
int
)
scaled_height
);
if
(
!
pass
->
texture
)
return
FALSE
;
...
...
@@ -354,19 +355,19 @@ clutter_blur_new (CoglTexture *texture,
BlurPass
*
vpass
;
g_return_val_if_fail
(
texture
!=
NULL
,
NULL
);
g_return_val_if_fail
(
radius
>=
0
.
0
,
NULL
);
g_return_val_if_fail
(
radius
>=
0
.
0
f
,
NULL
);
width
=
cogl_texture_get_width
(
texture
);
height
=
cogl_texture_get_height
(
texture
);
blur
=
g_new0
(
ClutterBlur
,
1
);
blur
->
sigma
=
radius
/
2
.
0
;
blur
->
sigma
=
radius
/
2
.
0
f
;
blur
->
source_texture
=
g_object_ref
(
texture
);
blur
->
downscale_factor
=
calculate_downscale_factor
(
width
,
height
,
blur
->
sigma
);
if
(
G_APPROX_VALUE
(
blur
->
sigma
,
0
.
0
,
FLT_EPSILON
))
if
(
G_APPROX_VALUE
(
blur
->
sigma
,
0
.
0
f
,
FLT_EPSILON
))
goto
out
;
vpass
=
&
blur
->
pass
[
VERTICAL
];
...
...
clutter/clutter/clutter-box-layout.c
View file @
faa99c8d
...
...
@@ -519,10 +519,10 @@ compare_gap (gconstpointer p1,
const
guint
*
c1
=
p1
;
const
guint
*
c2
=
p2
;
const
g
int
d1
=
MAX
(
sizes
[
*
c1
].
natural_size
-
const
int
d1
=
(
int
)
MAX
(
sizes
[
*
c1
].
natural_size
-
sizes
[
*
c1
].
minimum_size
,
0
);
const
g
int
d2
=
MAX
(
sizes
[
*
c2
].
natural_size
-
const
int
d2
=
(
int
)
MAX
(
sizes
[
*
c2
].
natural_size
-
sizes
[
*
c2
].
minimum_size
,
0
);
...
...
@@ -601,7 +601,7 @@ distribute_natural_allocation (float extra_space,
* Sort order and reducing remaining space by assigned space
* ensures that space is distributed equally.
*/
float
glue
=
(
extra_space
+
i
)
/
(
i
+
1
.
0
);
float
glue
=
(
extra_space
+
i
)
/
(
i
+
1
.
0
f
);
float
gap
=
sizes
[(
spreading
[
i
])].
natural_size
-
sizes
[(
spreading
[
i
])].
minimum_size
;
...
...
@@ -654,9 +654,9 @@ clutter_box_layout_allocate (ClutterLayoutManager *layout,
sizes
=
g_newa
(
RequestedSize
,
nvis_children
);
if
(
priv
->
orientation
==
CLUTTER_ORIENTATION_VERTICAL
)
size
=
box
->
y2
-
box
->
y1
-
(
nvis_children
-
1
)
*
priv
->
spacing
;
size
=
(
int
)
(
box
->
y2
-
box
->
y1
-
(
nvis_children
-
1
)
*
priv
->
spacing
)
;
else
size
=
box
->
x2
-
box
->
x1
-
(
nvis_children
-
1
)
*
priv
->
spacing
;
size
=
(
int
)
(
box
->
x2
-
box
->
x1
-
(
nvis_children
-
1
)
*
priv
->
spacing
)
;
actor
=
CLUTTER_ACTOR
(
container
);
...
...
@@ -710,7 +710,7 @@ clutter_box_layout_allocate (ClutterLayoutManager *layout,
?
box
->
x2
-
box
->
x1
:
box
->
y2
-
box
->
y1
);
size
-=
sizes
[
i
].
minimum_size
;
size
-=
(
int
)
sizes
[
i
].
minimum_size
;
sizes
[
i
].
actor
=
child
;
...
...
@@ -723,9 +723,9 @@ clutter_box_layout_allocate (ClutterLayoutManager *layout,
* minimum sizes for children that are not going to fill
*/
if
(
priv
->
orientation
==
CLUTTER_ORIENTATION_VERTICAL
)
size
=
box
->
y2
-
box
->
y1
-
(
nvis_children
-
1
)
*
priv
->
spacing
;
size
=
(
int
)
(
box
->
y2
-
box
->
y1
-
(
nvis_children
-
1
)
*
priv
->
spacing
)
;
else
size
=
box
->
x2
-
box
->
x1
-
(
nvis_children
-
1
)
*
priv
->
spacing
;
size
=
(
int
)
(
box
->
x2
-
box
->
x1
-
(
nvis_children
-
1
)
*
priv
->
spacing
)
;
extra
=
size
/
nvis_children
;
n_extra_widgets
=
size
%
nvis_children
;
...
...
@@ -763,14 +763,14 @@ clutter_box_layout_allocate (ClutterLayoutManager *layout,
if
(
priv
->
orientation
==
CLUTTER_ORIENTATION_VERTICAL
)
{
child_allocation
.
x1
=
box
->
x1
;
child_allocation
.
x2
=
MAX
(
1
.
0
,
box
->
x2
);
y
=
box
->
y1
;
child_allocation
.
x2
=
MAX
(
1
.
0
f
,
box
->
x2
);
y
=
(
int
)
box
->
y1
;
}
else
{
child_allocation
.
y1
=
box
->
y1
;
child_allocation
.
y2
=
MAX
(
1
.
0
,
box
->
y2
);
x
=
box
->
x1
;
child_allocation
.
y2
=
MAX
(
1
.
0
f
,
box
->
y2
);
x
=
(
int
)
box
->
x1
;
}
i
=
0
;
...
...
@@ -814,7 +814,7 @@ clutter_box_layout_allocate (ClutterLayoutManager *layout,
if
(
clutter_actor_needs_expand
(
child
,
priv
->
orientation
))
{
child_allocation
.
y1
=
y
;
child_allocation
.
y2
=
child_allocation
.
y1
+
MAX
(
1
.
0
,
child_size
);
child_allocation
.
y2
=
child_allocation
.
y1
+
MAX
(
1
.
0
f
,
child_size
);
}
else
{
...
...
@@ -822,14 +822,14 @@ clutter_box_layout_allocate (ClutterLayoutManager *layout,
child_allocation
.
y2
=
child_allocation
.
y1
+
sizes
[
i
].
minimum_size
;
}
y
+=
child_size
+
priv
->
spacing
;
y
+=
(
int
)
(
child_size
+
priv
->
spacing
)
;
}
else
/* CLUTTER_ORIENTATION_HORIZONTAL */
{
if
(
clutter_actor_needs_expand
(
child
,
priv
->
orientation
))
{
child_allocation
.
x1
=
x
;
child_allocation
.
x2
=
child_allocation
.
x1
+
MAX
(
1
.
0
,
child_size
);
child_allocation
.
x2
=
child_allocation
.
x1
+
MAX
(
1
.
0
f
,
child_size
);
}
else
{
...
...
@@ -837,7 +837,7 @@ clutter_box_layout_allocate (ClutterLayoutManager *layout,
child_allocation
.
x2
=
child_allocation
.
x1
+
sizes
[
i
].
minimum_size
;
}
x
+=
child_size
+
priv
->
spacing
;
x
+=
(
int
)
(
child_size
+
priv
->
spacing
)
;
if
(
is_rtl
)
{
...
...
clutter/clutter/clutter-brightness-contrast-effect.c
View file @
faa99c8d
...
...
@@ -76,8 +76,8 @@ static const gchar *brightness_contrast_source =
"cogl_color_out.rgb = ((cogl_color_out.rgb - 0.5 * cogl_color_out.a) *
\n
"
" contrast + 0.5 * cogl_color_out.a);
\n
"
;
static
const
C
lutter
Color
no_brightness_change
=
{
0x7f
,
0x7f
,
0x7f
,
0xff
};
static
const
C
lutter
Color
no_contrast_change
=
{
0x7f
,
0x7f
,
0x7f
,
0xff
};
static
const
C
ogl
Color
no_brightness_change
=
{
0x7f
,
0x7f
,
0x7f
,
0xff
};
static
const
C
ogl
Color
no_contrast_change
=
{
0x7f
,
0x7f
,
0x7f
,
0xff
};
static
const
gfloat
no_change
=
0
.
0
f
;
enum
...
...
@@ -165,7 +165,7 @@ clutter_brightness_contrast_effect_set_property (GObject *gobject,
{
case
PROP_BRIGHTNESS
:
{
const
C
lutter
Color
*
color
=
c
lutter
_value_get_color
(
value
);
const
C
ogl
Color
*
color
=
c
ogl
_value_get_color
(
value
);
clutter_brightness_contrast_effect_set_brightness_full
(
effect
,
color
->
red
/
127
.
0
f
-
1
.
0
f
,
color
->
green
/
127
.
0
f
-
1
.
0
f
,
...
...
@@ -175,7 +175,7 @@ clutter_brightness_contrast_effect_set_property (GObject *gobject,
case
PROP_CONTRAST
:
{
const
C
lutter
Color
*
color
=
c
lutter
_value_get_color
(
value
);
const
C
ogl
Color
*
color
=
c
ogl
_value_get_color
(
value
);
clutter_brightness_contrast_effect_set_contrast_full
(
effect
,
color
->
red
/
127
.
0
f
-
1
.
0
f
,
color
->
green
/
127
.
0
f
-
1
.
0
f
,
...
...
@@ -198,29 +198,29 @@ clutter_brightness_contrast_effect_get_property (GObject *gobject,
ClutterBrightnessContrastEffect
*
effect
=
CLUTTER_BRIGHTNESS_CONTRAST_EFFECT
(
gobject
);
ClutterBrightnessContrastEffectPrivate
*
priv
=
clutter_brightness_contrast_effect_get_instance_private
(
effect
);
C
lutter
Color
color
;
C
ogl
Color
color
;
switch
(
prop_id
)
{
case
PROP_BRIGHTNESS
:
{
color
.
red
=
(
priv
->
brightness_red
+
1
.
0
f
)
*
127
.
0
f
;
color
.
green
=
(
priv
->
brightness_green
+
1
.
0
f
)
*
127
.
0
f
;
color
.
blue
=
(
priv
->
brightness_blue
+
1
.
0
f
)
*
127
.
0
f
;
color
.
red
=
(
uint8_t
)
(
(
priv
->
brightness_red
+
1
.
0
f
)
*
127
.
0
f
)
;
color
.
green
=
(
uint8_t
)
(
(
priv
->
brightness_green
+
1
.
0
f
)
*
127
.
0
f
)
;
color
.
blue
=
(
uint8_t
)
(
(
priv
->
brightness_blue
+
1
.
0
f
)
*
127
.
0
f
)
;
color
.
alpha
=
0xff
;
c
lutter
_value_set_color
(
value
,
&
color
);
c
ogl
_value_set_color
(
value
,
&
color
);
}
break
;
case
PROP_CONTRAST
:
{
color
.
red
=
(
priv
->
contrast_red
+
1
.
0
f
)
*
127
.
0
f
;
color
.
green
=
(
priv
->
contrast_green
+
1
.
0
f
)
*
127
.
0
f
;
color
.
blue
=
(
priv
->
contrast_blue
+
1
.
0
f
)
*
127
.
0
f
;
color
.
red
=
(
uint8_t
)
(
(
priv
->
contrast_red
+
1
.
0
f
)
*
127
.
0
f
)
;
color
.
green
=
(
uint8_t
)
(
(
priv
->
contrast_green
+
1
.
0
f
)
*
127
.
0
f
)
;
color
.
blue
=
(
uint8_t
)
(
(
priv
->
contrast_blue
+
1
.
0
f
)
*
127
.
0
f
)
;
color
.
alpha
=
0xff
;
c
lutter
_value_set_color
(
value
,
&
color
);
c
ogl
_value_set_color
(
value
,
&
color
);
}
break
;
...
...
@@ -251,14 +251,14 @@ clutter_brightness_contrast_effect_class_init (ClutterBrightnessContrastEffectCl
*
* The brightness change to apply to the effect.
*
* This property uses a #C
lutter
Color to represent the changes to each
* This property uses a #C
ogl
Color to represent the changes to each
* color channel. The range is [ 0, 255 ], with 127 as the value used
* to indicate no change; values smaller than 127 indicate a decrease
* in brightness, and values larger than 127 indicate an increase in
* brightness.
*/
obj_props
[
PROP_BRIGHTNESS
]
=
c
lutter
_param_spec_color
(
"brightness"
,
NULL
,
NULL
,
c
ogl
_param_spec_color
(
"brightness"
,
NULL
,
NULL
,
&
no_brightness_change
,
G_PARAM_READWRITE
|
G_PARAM_STATIC_STRINGS
);
...
...
@@ -268,14 +268,14 @@ clutter_brightness_contrast_effect_class_init (ClutterBrightnessContrastEffectCl
*
* The contrast change to apply to the effect.
*
* This property uses a #C
lutter
Color to represent the changes to each
* This property uses a #C
ogl
Color to represent the changes to each
* color channel. The range is [ 0, 255 ], with 127 as the value used
* to indicate no change; values smaller than 127 indicate a decrease
* in contrast, and values larger than 127 indicate an increase in
* contrast.
*/
obj_props
[
PROP_CONTRAST
]
=
c
lutter
_param_spec_color
(
"contrast"
,
NULL
,
NULL
,
c
ogl
_param_spec_color
(
"contrast"
,
NULL
,
NULL
,
&
no_contrast_change
,
G_PARAM_READWRITE
|
G_PARAM_STATIC_STRINGS
);
...
...
@@ -337,9 +337,9 @@ update_uniforms (ClutterBrightnessContrastEffect *self)
if
(
priv
->
contrast_uniform
>
-
1
)
{
float
contrast
[
3
]
=
{
tan
((
priv
->
contrast_red
+
1
)
*
G_PI_4
),
tan
((
priv
->
contrast_green
+
1
)
*
G_PI_4
),
tan
((
priv
->
contrast_blue
+
1
)
*
G_PI_4
)
(
float
)
tan
((
priv
->
contrast_red
+
1
)
*
G_PI_4
),
(
float
)
tan
((
priv
->
contrast_green
+
1
)
*
G_PI_4
),
(
float
)
tan
((
priv
->
contrast_blue
+
1
)
*
G_PI_4
)
};
cogl_pipeline_set_uniform_float
(
priv
->
pipeline
,
...
...
@@ -374,6 +374,8 @@ clutter_brightness_contrast_effect_init (ClutterBrightnessContrastEffect *self)
clutter_backend_get_cogl_context
(
clutter_get_default_backend
());
klass
->
base_pipeline
=
cogl_pipeline_new
(
ctx
);
cogl_pipeline_set_static_name
(
klass
->
base_pipeline
,
"ClutterBrightnessContrast"
);
snippet
=
cogl_snippet_new
(
COGL_SNIPPET_HOOK_FRAGMENT
,
brightness_contrast_decls
,
...
...
Prev
1
2
3
4
5
…
36
Next