Compare commits
117 Commits
wip/nields
...
wip/run-te
Author | SHA1 | Date | |
---|---|---|---|
![]() |
59fb26cb00 | ||
![]() |
87c734cef9 | ||
![]() |
c755fb6995 | ||
![]() |
e9cc220c8e | ||
![]() |
92f210039e | ||
![]() |
aef393efd0 | ||
![]() |
6836317e41 | ||
![]() |
61e51cdef6 | ||
![]() |
7868ab761f | ||
![]() |
e6c8939c30 | ||
![]() |
ac5d9ec558 | ||
![]() |
9c8ff5dbe8 | ||
![]() |
7738316dff | ||
![]() |
1c3d8defb5 | ||
![]() |
b2ae03c428 | ||
![]() |
456698c814 | ||
![]() |
9189b7b512 | ||
![]() |
4259cfd4c6 | ||
![]() |
4fdefb5b2e | ||
![]() |
5ca0ef078d | ||
![]() |
a5265365dd | ||
![]() |
62f576e15b | ||
![]() |
73bc3c4426 | ||
![]() |
57772e5850 | ||
![]() |
7c8baf8ed9 | ||
![]() |
0e3c062406 | ||
![]() |
4bc7425332 | ||
![]() |
a2a8f0cdaa | ||
![]() |
faa7b2d4e5 | ||
![]() |
a95644dbdc | ||
![]() |
720f363241 | ||
![]() |
3794df608c | ||
![]() |
2c893beff1 | ||
![]() |
a3c425ad89 | ||
![]() |
1d144486d1 | ||
![]() |
9cd3b07472 | ||
![]() |
6061abbf90 | ||
![]() |
55c084e6e1 | ||
![]() |
45289b3d65 | ||
![]() |
6df34eb4b7 | ||
![]() |
3e68c9e8fa | ||
![]() |
fc0ce11fcd | ||
![]() |
c08a24bb40 | ||
![]() |
78560b8426 | ||
![]() |
0eab73dc2e | ||
![]() |
dd8c8e82f2 | ||
![]() |
62f4e0501f | ||
![]() |
6d8293a422 | ||
![]() |
b80250e483 | ||
![]() |
bd0f1bd338 | ||
![]() |
2439255f32 | ||
![]() |
c327b2df95 | ||
![]() |
9aee47daa9 | ||
![]() |
ecf7e53206 | ||
![]() |
8038eaa99f | ||
![]() |
9bcb50fa09 | ||
![]() |
c17af6c794 | ||
![]() |
4a184d74d5 | ||
![]() |
1f133b3ed2 | ||
![]() |
84616bef27 | ||
![]() |
040de396b2 | ||
![]() |
5a4bc15d0b | ||
![]() |
01e20a6ba9 | ||
![]() |
b0b1ff36ae | ||
![]() |
5ed9abd51a | ||
![]() |
65c5260312 | ||
![]() |
7d9674149f | ||
![]() |
25376b3b3c | ||
![]() |
b86a67c80a | ||
![]() |
7419ab7de5 | ||
![]() |
6b853ffdbd | ||
![]() |
ad220fc025 | ||
![]() |
5bd85ef7e5 | ||
![]() |
73f83f1ab6 | ||
![]() |
5cb6286436 | ||
![]() |
1c25b75571 | ||
![]() |
f2f4af0d50 | ||
![]() |
a8f8bc563e | ||
![]() |
46248748a9 | ||
![]() |
da7372a2fa | ||
![]() |
de97b54595 | ||
![]() |
d7d97f2477 | ||
![]() |
7776941b89 | ||
![]() |
4061c8384b | ||
![]() |
b850f5a732 | ||
![]() |
7645c51c54 | ||
![]() |
f1837b785b | ||
![]() |
22978b9d07 | ||
![]() |
1206879a20 | ||
![]() |
dc5925b7d1 | ||
![]() |
b138006bb7 | ||
![]() |
bca08c2c4e | ||
![]() |
6541d49fe7 | ||
![]() |
c3c6668343 | ||
![]() |
70de90ebce | ||
![]() |
0756fd4636 | ||
![]() |
8c339dac3e | ||
![]() |
06a7c22bcd | ||
![]() |
ca88826ce9 | ||
![]() |
7229a07b6c | ||
![]() |
85f4772a4f | ||
![]() |
f2fb3945d1 | ||
![]() |
d7d75dd8e7 | ||
![]() |
54fe0d311d | ||
![]() |
fefac75e96 | ||
![]() |
5e46940332 | ||
![]() |
1767672375 | ||
![]() |
6fc4cd3c0c | ||
![]() |
feb9d129db | ||
![]() |
2b519cba36 | ||
![]() |
832fc798d5 | ||
![]() |
bd0743a421 | ||
![]() |
20731887f2 | ||
![]() |
980d9b1042 | ||
![]() |
bd7704f9e1 | ||
![]() |
68f18f1fe9 | ||
![]() |
c655166398 |
@@ -28,6 +28,20 @@ build-mutter:
|
||||
- merge_requests
|
||||
- /^.*$/
|
||||
|
||||
build-without-native-backend:
|
||||
stage: build
|
||||
script:
|
||||
- meson . build -Dbuildtype=debugoptimized -Dnative_backend=false -Dudev=false --werror --prefix /usr
|
||||
- ninja -C build
|
||||
- ninja -C build install
|
||||
artifacts:
|
||||
expire_in: 1 day
|
||||
paths:
|
||||
- build
|
||||
only:
|
||||
- merge_requests
|
||||
- /^.*$/
|
||||
|
||||
test-mutter:
|
||||
stage: test
|
||||
dependencies:
|
||||
|
@@ -1,21 +1,31 @@
|
||||
# Rebuild and push with
|
||||
#
|
||||
# cd .gitlab-ci/
|
||||
# docker build -t registry.gitlab.gnome.org/gnome/mutter/master:v2 .
|
||||
# docker push registry.gitlab.gnome.org/gnome/mutter/master:v2
|
||||
#
|
||||
|
||||
FROM fedora:30
|
||||
|
||||
RUN dnf -y update && dnf -y upgrade && \
|
||||
dnf install -y 'dnf-command(builddep)' && \
|
||||
dnf install -y 'dnf-command(copr)' && \
|
||||
dnf copr enable -y fmuellner/gnome-shell-ci && \
|
||||
dnf copr enable -y jadahl/mutter-ci && \
|
||||
dnf copr enable -y hergertme/sysprof-3 && \
|
||||
|
||||
dnf builddep -y mutter && \
|
||||
|
||||
# Until Fedora catches up with meson build-deps
|
||||
dnf install -y meson xorg-x11-server-Xorg gnome-settings-daemon-devel egl-wayland-devel xorg-x11-server-Xwayland && \
|
||||
|
||||
# Until Fedora catches up with mesa bug fixes
|
||||
dnf upgrade -y mesa-dri-drivers mesa-libEGL && \
|
||||
|
||||
# For running unit tests
|
||||
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 '*/xvfb-run' gdm-lib accountsservice-libs && \
|
||||
|
||||
# Unpackaged versions
|
||||
dnf install -y https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00834984-gsettings-desktop-schemas/gsettings-desktop-schemas-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm https://copr-be.cloud.fedoraproject.org/results/jadahl/mutter-ci/fedora-29-x86_64/00834984-gsettings-desktop-schemas/gsettings-desktop-schemas-devel-3.30.1-1.20181206git918efdd69be53.fc29.x86_64.rpm && \
|
||||
dnf install -y https://copr-be.cloud.fedoraproject.org/results/hergertme/sysprof-3/fedora-30-x86_64/00917385-sysprof/libsysprof-ui-3.33.2-1.fc30.x86_64.rpm https://copr-be.cloud.fedoraproject.org/results/hergertme/sysprof-3/fedora-30-x86_64/00917385-sysprof/sysprof-cli-3.33.2-1.fc30.x86_64.rpm https://copr-be.cloud.fedoraproject.org/results/hergertme/sysprof-3/fedora-30-x86_64/00917385-sysprof/sysprof-3.33.2-1.fc30.x86_64.rpm https://copr-be.cloud.fedoraproject.org/results/hergertme/sysprof-3/fedora-30-x86_64/00917385-sysprof/sysprof-devel-3.33.2-1.fc30.x86_64.rpm && \
|
||||
dnf install -y sysprof-devel && \
|
||||
|
||||
dnf install -y intltool redhat-rpm-config make && \
|
||||
|
||||
|
66
NEWS
66
NEWS
@@ -1,3 +1,69 @@
|
||||
3.33.4
|
||||
======
|
||||
* Discard page flip retries on hotplug [Jonas; !630]
|
||||
* Add xdg-output v2 support [Olivier; #645]
|
||||
* Restore DRM format fallbacks [Jonas; !662]
|
||||
* Don't emit ::size-changed when only position changed [Daniel; !568]
|
||||
* Expose workspace layout properties [Florian; !618]
|
||||
* Don't use grab modifiers when shortcuts are inhibited [Olivier; #642]
|
||||
* Fix stuttering due to unchanged power save mode notifications [Georges; !674]
|
||||
* Add API to reorder workspaces [Adam; !670]
|
||||
* Make picking a new focus window more reliable [Marco; !669]
|
||||
* Defer actor allocation till shown [Carlos; !677]
|
||||
* Try to use primary GPU for copy instead of glReadPixels [Pekka; !615]
|
||||
* Unset pointer focus when the cursor is hidden [Jonas D.; !448]
|
||||
* Fix modifier-drag on wayland subsurfaces [Robert; !604]
|
||||
* Fix background corruption on Nvidia after resuming from suspend [Daniel; !600]
|
||||
* Only grab the locate-pointer key when necessary [Olivier; !685, #647]
|
||||
* Misc. bug fixes and cleanups [Florian, Jonas, Daniel, Robert, Olivier,
|
||||
Georges, Marco, Carlos, Emmanuele; !648, !650, !647, !656, !658, !637,
|
||||
!663, !660, !659, !665, !666, !668, !667, #667, !676, !678, #672, !680,
|
||||
!683, !688, !689, !687]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Emmanuele Bassi, Adam Bieńkowski, Piotr Drąg, Jonas Dreßler,
|
||||
Olivier Fourdan, Carlos Garnacho, Robert Mader, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Pekka Paalanen, Marco Trevisan (Treviño),
|
||||
Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Fabio Tomat [fur], Kukuh Syafaat [id]
|
||||
|
||||
3.33.3
|
||||
======
|
||||
* Prepare for running Xwayland on demand [Carlos; !420]
|
||||
* Fix text selection color rendering [Florian; #494]
|
||||
* Fix black shadows when using fractional scaling [Robert; #609]
|
||||
* Honor startup sequence workspace on wayland [Carlos; gnome-shell#674]
|
||||
* Only emit 'grab-op-end` signal after dropping grabs [Marco; !596]
|
||||
* Add a Sysprof-based profiler [Jonas, Georges; !197, !603]
|
||||
* Relax "xwayland-allow-grabs" setting [Olivier; #597]
|
||||
* Implement locate-pointer accessibility feature [Olivier; !453]
|
||||
* Implement mouse accessibility [Olivier; !512]
|
||||
* Consolidate frame throttling [Daniel, Georges; !363]
|
||||
* Fix setting blank cursor under wayland [Jonas; #630]
|
||||
* Pixel-align OpenGL cursors [Jonas; !610]
|
||||
* Handle returning from fullscreen/maximization better [Jonas; !621]
|
||||
* Improve screencast support on multi-monitor systems [Georges; !623]
|
||||
* Fix running X11 applications with sudo under wayland [Hans; #643]
|
||||
* Implement toggle-keys notification [Olivier; #637]
|
||||
* Add initial KMS transactional support [Jonas; !525]
|
||||
* Improve finding new focus window when the old one is closed [Marco; #308]
|
||||
* Misc. bug fixes and cleanups [Jonas, Carlos, Marco, Florian, Pekka, Robert,
|
||||
Douglas, Georges, Daniel, Emil, Niels, Hans, Olivier, Ting-Wei, Corentin;
|
||||
!591, #398, !592, !581, !597, !598, !593, !497, #591, !545, gtk#1675, !601,
|
||||
#568, !564, !605, !609, !115, !214, !611, !617, !616, !619, !624, !622, !627,
|
||||
!628, !629, !632, !633, !631, !636, !639, !638, !634, !640, !529, !644, !590]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Piotr Drąg, Olivier Fourdan, Carlos Garnacho, Hans de Goede,
|
||||
Niels De Graef, Ting-Wei Lan, Robert Mader, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Corentin Noël, Pekka Paalanen, Douglas R. Reno,
|
||||
Marco Trevisan (Treviño), Emil Velikov, Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Balázs Úr [hu], Daniel Mustieles [es], Nathan Follens [nl], Goran Vidović [hr]
|
||||
|
||||
3.33.2
|
||||
======
|
||||
* Fix rendering lag on Xorg [Daniel; !520, !281]
|
||||
|
@@ -10107,6 +10107,9 @@ clutter_actor_allocate (ClutterActor *self,
|
||||
return;
|
||||
}
|
||||
|
||||
if (!clutter_actor_is_visible (self))
|
||||
return;
|
||||
|
||||
priv = self->priv;
|
||||
|
||||
old_allocation = priv->allocation;
|
||||
|
@@ -17,7 +17,6 @@
|
||||
#include "deprecated/clutter-container.h"
|
||||
#include "deprecated/clutter-group.h"
|
||||
#include "deprecated/clutter-keysyms.h"
|
||||
#include "deprecated/clutter-main.h"
|
||||
#include "deprecated/clutter-rectangle.h"
|
||||
#include "deprecated/clutter-stage-manager.h"
|
||||
#include "deprecated/clutter-stage.h"
|
||||
|
@@ -277,24 +277,6 @@ typedef enum
|
||||
CLUTTER_ANIMATION_LAST
|
||||
} ClutterAnimationMode;
|
||||
|
||||
/**
|
||||
* ClutterFontFlags:
|
||||
* @CLUTTER_FONT_MIPMAPPING: Set to use mipmaps for the glyph cache textures.
|
||||
* @CLUTTER_FONT_HINTING: Set to enable hinting on the glyphs.
|
||||
*
|
||||
* Runtime flags to change the font quality. To be used with
|
||||
* clutter_set_font_flags().
|
||||
*
|
||||
* Since: 1.0
|
||||
*
|
||||
* Deprecated: 1.22: Use #cairo_font_options_t instead
|
||||
*/
|
||||
typedef enum /*< prefix=CLUTTER_FONT >*/
|
||||
{
|
||||
CLUTTER_FONT_MIPMAPPING = (1 << 0),
|
||||
CLUTTER_FONT_HINTING = (1 << 1)
|
||||
} ClutterFontFlags;
|
||||
|
||||
/**
|
||||
* ClutterTextDirection:
|
||||
* @CLUTTER_TEXT_DIRECTION_DEFAULT: Use the default setting, as returned
|
||||
|
@@ -85,8 +85,6 @@ G_LOCK_DEFINE_STATIC (ClutterCntx);
|
||||
|
||||
/* main lock and locking/unlocking functions */
|
||||
static GMutex clutter_threads_mutex;
|
||||
static GCallback clutter_threads_lock = NULL;
|
||||
static GCallback clutter_threads_unlock = NULL;
|
||||
|
||||
/* command line options */
|
||||
static gboolean clutter_is_initialized = FALSE;
|
||||
@@ -146,38 +144,10 @@ static const GDebugKey clutter_paint_debug_keys[] = {
|
||||
{ "damage-region", CLUTTER_DEBUG_PAINT_DAMAGE_REGION },
|
||||
};
|
||||
|
||||
static void
|
||||
clutter_threads_impl_lock (void)
|
||||
{
|
||||
g_mutex_lock (&clutter_threads_mutex);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_threads_impl_unlock (void)
|
||||
{
|
||||
/* we need to trylock here, in case the lock hasn't been acquired; on
|
||||
* various systems trying to release a mutex that hasn't been acquired
|
||||
* will cause a run-time error. trylock() will either fail, in which
|
||||
* case we can release the lock we own; or it will succeeds, in which
|
||||
* case we need to release the lock we just acquired. so we ignore the
|
||||
* returned value.
|
||||
*
|
||||
* see: https://bugs.gnome.org/679439
|
||||
*/
|
||||
g_mutex_trylock (&clutter_threads_mutex);
|
||||
g_mutex_unlock (&clutter_threads_mutex);
|
||||
}
|
||||
|
||||
static inline void
|
||||
clutter_threads_init_default (void)
|
||||
{
|
||||
g_mutex_init (&clutter_threads_mutex);
|
||||
|
||||
if (clutter_threads_lock == NULL)
|
||||
clutter_threads_lock = clutter_threads_impl_lock;
|
||||
|
||||
if (clutter_threads_unlock == NULL)
|
||||
clutter_threads_unlock = clutter_threads_impl_unlock;
|
||||
}
|
||||
|
||||
#define ENVIRONMENT_GROUP "Environment"
|
||||
@@ -383,28 +353,6 @@ clutter_config_read (void)
|
||||
g_free (config_path);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_get_show_fps:
|
||||
*
|
||||
* Returns whether Clutter should print out the frames per second on the
|
||||
* console. You can enable this setting either using the
|
||||
* <literal>CLUTTER_SHOW_FPS</literal> environment variable or passing
|
||||
* the <literal>--clutter-show-fps</literal> command line argument. *
|
||||
*
|
||||
* Return value: %TRUE if Clutter should show the FPS.
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
* Deprecated: 1.10: This function does not do anything. Use the environment
|
||||
* variable or the configuration file to determine whether Clutter should
|
||||
* print out the FPS counter on the console.
|
||||
*/
|
||||
gboolean
|
||||
clutter_get_show_fps (void)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_context_get_show_fps (void)
|
||||
{
|
||||
@@ -453,86 +401,6 @@ clutter_disable_accessibility (void)
|
||||
clutter_enable_accessibility = FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_redraw:
|
||||
*
|
||||
* Forces a redraw of the entire stage. Applications should never use this
|
||||
* function, but queue a redraw using clutter_actor_queue_redraw().
|
||||
*
|
||||
* This function should only be used by libraries integrating Clutter from
|
||||
* within another toolkit.
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_stage_ensure_redraw() instead.
|
||||
*/
|
||||
void
|
||||
clutter_redraw (ClutterStage *stage)
|
||||
{
|
||||
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
||||
|
||||
clutter_stage_ensure_redraw (stage);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_set_motion_events_enabled:
|
||||
* @enable: %TRUE to enable per-actor motion events
|
||||
*
|
||||
* Sets whether per-actor motion events should be enabled or not on
|
||||
* all #ClutterStage<!-- -->s managed by Clutter.
|
||||
*
|
||||
* If @enable is %FALSE the following events will not work:
|
||||
*
|
||||
* - ClutterActor::motion-event, except on the #ClutterStage
|
||||
* - ClutterActor::enter-event
|
||||
* - ClutterActor::leave-event
|
||||
*
|
||||
* Since: 0.6
|
||||
*
|
||||
* Deprecated: 1.8: Use clutter_stage_set_motion_events_enabled() instead.
|
||||
*/
|
||||
void
|
||||
clutter_set_motion_events_enabled (gboolean enable)
|
||||
{
|
||||
ClutterStageManager *stage_manager;
|
||||
ClutterMainContext *context;
|
||||
const GSList *l;
|
||||
|
||||
enable = !!enable;
|
||||
|
||||
context = _clutter_context_get_default ();
|
||||
if (context->motion_events_per_actor == enable)
|
||||
return;
|
||||
|
||||
/* store the flag for later query and for newly created stages */
|
||||
context->motion_events_per_actor = enable;
|
||||
|
||||
/* propagate the change to all stages */
|
||||
stage_manager = clutter_stage_manager_get_default ();
|
||||
|
||||
for (l = clutter_stage_manager_peek_stages (stage_manager);
|
||||
l != NULL;
|
||||
l = l->next)
|
||||
{
|
||||
clutter_stage_set_motion_events_enabled (l->data, enable);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_get_motion_events_enabled:
|
||||
*
|
||||
* Gets whether the per-actor motion events are enabled.
|
||||
*
|
||||
* Return value: %TRUE if the motion events are enabled
|
||||
*
|
||||
* Since: 0.6
|
||||
*
|
||||
* Deprecated: 1.8: Use clutter_stage_get_motion_events_enabled() instead.
|
||||
*/
|
||||
gboolean
|
||||
clutter_get_motion_events_enabled (void)
|
||||
{
|
||||
return _clutter_context_get_motion_events_enabled ();
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_id_to_color (guint id_,
|
||||
ClutterColor *col)
|
||||
@@ -784,69 +652,6 @@ clutter_main (void)
|
||||
clutter_main_loop_level--;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_threads_init:
|
||||
*
|
||||
* Initialises the Clutter threading mechanism, so that Clutter API can be
|
||||
* called by multiple threads, using clutter_threads_enter() and
|
||||
* clutter_threads_leave() to mark the critical sections.
|
||||
*
|
||||
* You must call g_thread_init() before this function.
|
||||
*
|
||||
* This function must be called before clutter_init().
|
||||
*
|
||||
* It is safe to call this function multiple times.
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
* Deprecated: 1.10: This function does not do anything. Threading support
|
||||
* is initialized when Clutter is initialized.
|
||||
*/
|
||||
void
|
||||
clutter_threads_init (void)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_threads_set_lock_functions: (skip)
|
||||
* @enter_fn: function called when aquiring the Clutter main lock
|
||||
* @leave_fn: function called when releasing the Clutter main lock
|
||||
*
|
||||
* Allows the application to replace the standard method that
|
||||
* Clutter uses to protect its data structures. Normally, Clutter
|
||||
* creates a single #GMutex that is locked by clutter_threads_enter(),
|
||||
* and released by clutter_threads_leave(); using this function an
|
||||
* application provides, instead, a function @enter_fn that is
|
||||
* called by clutter_threads_enter() and a function @leave_fn that is
|
||||
* called by clutter_threads_leave().
|
||||
*
|
||||
* The functions must provide at least same locking functionality
|
||||
* as the default implementation, but can also do extra application
|
||||
* specific processing.
|
||||
*
|
||||
* As an example, consider an application that has its own recursive
|
||||
* lock that when held, holds the Clutter lock as well. When Clutter
|
||||
* unlocks the Clutter lock when entering a recursive main loop, the
|
||||
* application must temporarily release its lock as well.
|
||||
*
|
||||
* Most threaded Clutter apps won't need to use this method.
|
||||
*
|
||||
* This method must be called before clutter_init(), and cannot
|
||||
* be called multiple times.
|
||||
*
|
||||
* Since: 0.4
|
||||
*/
|
||||
void
|
||||
clutter_threads_set_lock_functions (GCallback enter_fn,
|
||||
GCallback leave_fn)
|
||||
{
|
||||
g_return_if_fail (clutter_threads_lock == NULL &&
|
||||
clutter_threads_unlock == NULL);
|
||||
|
||||
clutter_threads_lock = enter_fn;
|
||||
clutter_threads_unlock = leave_fn;
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_threads_dispatch (gpointer data)
|
||||
{
|
||||
@@ -903,17 +708,11 @@ _clutter_threads_dispatch_free (gpointer data)
|
||||
* SafeClosure *closure = data;
|
||||
* gboolean res = FALSE;
|
||||
*
|
||||
* // mark the critical section //
|
||||
*
|
||||
* clutter_threads_enter();
|
||||
*
|
||||
* // the callback does not need to acquire the Clutter
|
||||
* / lock itself, as it is held by the this proxy handler
|
||||
* //
|
||||
* res = closure->callback (closure->data);
|
||||
*
|
||||
* clutter_threads_leave();
|
||||
*
|
||||
* return res;
|
||||
* }
|
||||
* static gulong
|
||||
@@ -1093,69 +892,23 @@ clutter_threads_add_timeout (guint interval,
|
||||
void
|
||||
_clutter_threads_acquire_lock (void)
|
||||
{
|
||||
if (clutter_threads_lock != NULL)
|
||||
(* clutter_threads_lock) ();
|
||||
g_mutex_lock (&clutter_threads_mutex);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_threads_release_lock (void)
|
||||
{
|
||||
if (clutter_threads_unlock != NULL)
|
||||
(* clutter_threads_unlock) ();
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_threads_enter:
|
||||
*
|
||||
* Locks the Clutter thread lock.
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
* Deprecated: 1.12: This function should not be used by application
|
||||
* code; marking critical sections is not portable on various
|
||||
* platforms. Instead of acquiring the Clutter lock, schedule UI
|
||||
* updates from the main loop using clutter_threads_add_idle() or
|
||||
* clutter_threads_add_timeout().
|
||||
*/
|
||||
void
|
||||
clutter_threads_enter (void)
|
||||
{
|
||||
_clutter_threads_acquire_lock ();
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_threads_leave:
|
||||
*
|
||||
* Unlocks the Clutter thread lock.
|
||||
*
|
||||
* Since: 0.4
|
||||
*
|
||||
* Deprecated: 1.12: This function should not be used by application
|
||||
* code; marking critical sections is not portable on various
|
||||
* platforms. Instead of acquiring the Clutter lock, schedule UI
|
||||
* updates from the main loop using clutter_threads_add_idle() or
|
||||
* clutter_threads_add_timeout().
|
||||
*/
|
||||
void
|
||||
clutter_threads_leave (void)
|
||||
{
|
||||
_clutter_threads_release_lock ();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* clutter_get_debug_enabled:
|
||||
*
|
||||
* Check if Clutter has debugging enabled.
|
||||
*
|
||||
* Return value: %FALSE
|
||||
*
|
||||
* Deprecated: 1.10: This function does not do anything.
|
||||
*/
|
||||
gboolean
|
||||
clutter_get_debug_enabled (void)
|
||||
{
|
||||
return FALSE;
|
||||
/* we need to trylock here, in case the lock hasn't been acquired; on
|
||||
* various systems trying to release a mutex that hasn't been acquired
|
||||
* will cause a run-time error. trylock() will either fail, in which
|
||||
* case we can release the lock we own; or it will succeeds, in which
|
||||
* case we need to release the lock we just acquired. so we ignore the
|
||||
* returned value.
|
||||
*
|
||||
* see: https://bugs.gnome.org/679439
|
||||
*/
|
||||
g_mutex_trylock (&clutter_threads_mutex);
|
||||
g_mutex_unlock (&clutter_threads_mutex);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1205,7 +958,6 @@ clutter_context_get_default_unlocked (void)
|
||||
ctx->settings = clutter_settings_get_default ();
|
||||
_clutter_settings_set_backend (ctx->settings, ctx->backend);
|
||||
|
||||
ctx->motion_events_per_actor = TRUE;
|
||||
ctx->last_repaint_id = 1;
|
||||
}
|
||||
|
||||
@@ -1226,36 +978,6 @@ _clutter_context_get_default (void)
|
||||
return retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_get_timestamp:
|
||||
*
|
||||
* Returns the approximate number of microseconds passed since Clutter was
|
||||
* intialised.
|
||||
*
|
||||
* This function shdould not be used by application code.
|
||||
*
|
||||
* The output of this function depends on whether Clutter was configured to
|
||||
* enable its debugging code paths, so it's less useful than intended.
|
||||
*
|
||||
* Since Clutter 1.10, this function is an alias to g_get_monotonic_time()
|
||||
* if Clutter was configured to enable the debugging code paths.
|
||||
*
|
||||
* Return value: Number of microseconds since clutter_init() was called, or
|
||||
* zero if Clutter was not configured with debugging code paths.
|
||||
*
|
||||
* Deprecated: 1.10: Use #GTimer or g_get_monotonic_time() for a proper
|
||||
* timing source
|
||||
*/
|
||||
gulong
|
||||
clutter_get_timestamp (void)
|
||||
{
|
||||
#ifdef CLUTTER_ENABLE_DEBUG
|
||||
return (gulong) g_get_monotonic_time ();
|
||||
#else
|
||||
return 0L;
|
||||
#endif
|
||||
}
|
||||
|
||||
static gboolean
|
||||
clutter_arg_direction_cb (const char *key,
|
||||
const char *value,
|
||||
@@ -2658,24 +2380,6 @@ clutter_get_default_frame_rate (void)
|
||||
return context->frame_rate;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_set_default_frame_rate:
|
||||
* @frames_per_sec: the new default frame rate
|
||||
*
|
||||
* Sets the default frame rate. This frame rate will be used to limit
|
||||
* the number of frames drawn if Clutter is not able to synchronize
|
||||
* with the vertical refresh rate of the display. When synchronization
|
||||
* is possible, this value is ignored.
|
||||
*
|
||||
* Since: 0.6
|
||||
*
|
||||
* Deprecated: 1.10: This function does not do anything any more.
|
||||
*/
|
||||
void
|
||||
clutter_set_default_frame_rate (guint frames_per_sec)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
on_grab_actor_destroy (ClutterActor *actor,
|
||||
ClutterInputDevice *device)
|
||||
@@ -2890,57 +2594,6 @@ clutter_input_device_get_grabbed_actor (ClutterInputDevice *device)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_grab_pointer_for_device:
|
||||
* @actor: a #ClutterActor
|
||||
* @id_: a device id, or -1
|
||||
*
|
||||
* Grabs all the pointer events coming from the device @id for @actor.
|
||||
*
|
||||
* If @id is -1 then this function is equivalent to clutter_grab_pointer().
|
||||
*
|
||||
* Since: 0.8
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_input_device_grab() instead.
|
||||
*/
|
||||
void
|
||||
clutter_grab_pointer_for_device (ClutterActor *actor,
|
||||
gint id_)
|
||||
{
|
||||
ClutterDeviceManager *manager;
|
||||
ClutterInputDevice *dev;
|
||||
|
||||
g_return_if_fail (actor == NULL || CLUTTER_IS_ACTOR (actor));
|
||||
|
||||
/* essentially a global grab */
|
||||
if (id_ == -1)
|
||||
{
|
||||
if (actor == NULL)
|
||||
clutter_ungrab_pointer ();
|
||||
else
|
||||
clutter_grab_pointer (actor);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
manager = clutter_device_manager_get_default ();
|
||||
if (manager == NULL)
|
||||
return;
|
||||
|
||||
dev = clutter_device_manager_get_device (manager, id_);
|
||||
if (dev == NULL)
|
||||
return;
|
||||
|
||||
if (dev->device_type != CLUTTER_POINTER_DEVICE)
|
||||
return;
|
||||
|
||||
if (actor == NULL)
|
||||
clutter_input_device_ungrab (dev);
|
||||
else
|
||||
clutter_input_device_grab (dev, actor);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* clutter_ungrab_pointer:
|
||||
*
|
||||
@@ -2954,32 +2607,6 @@ clutter_ungrab_pointer (void)
|
||||
clutter_grab_pointer (NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_ungrab_pointer_for_device:
|
||||
* @id_: a device id
|
||||
*
|
||||
* Removes an existing grab of the pointer events for device @id_.
|
||||
*
|
||||
* Since: 0.8
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_input_device_ungrab() instead.
|
||||
*/
|
||||
void
|
||||
clutter_ungrab_pointer_for_device (gint id_)
|
||||
{
|
||||
ClutterDeviceManager *manager;
|
||||
ClutterInputDevice *device;
|
||||
|
||||
manager = clutter_device_manager_get_default ();
|
||||
if (manager == NULL)
|
||||
return;
|
||||
|
||||
device = clutter_device_manager_get_device (manager, id_);
|
||||
if (device != NULL)
|
||||
clutter_input_device_ungrab (device);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* clutter_get_pointer_grab:
|
||||
*
|
||||
@@ -3079,170 +2706,6 @@ clutter_get_keyboard_grab (void)
|
||||
return context->keyboard_grab_actor;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_clear_glyph_cache:
|
||||
*
|
||||
* Clears the internal cache of glyphs used by the Pango
|
||||
* renderer. This will free up some memory and GL texture
|
||||
* resources. The cache will be automatically refilled as more text is
|
||||
* drawn.
|
||||
*
|
||||
* Since: 0.8
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_get_font_map() and
|
||||
* cogl_pango_font_map_clear_glyph_cache() instead.
|
||||
*/
|
||||
void
|
||||
clutter_clear_glyph_cache (void)
|
||||
{
|
||||
CoglPangoFontMap *font_map;
|
||||
|
||||
font_map = clutter_context_get_pango_fontmap ();
|
||||
cogl_pango_font_map_clear_glyph_cache (font_map);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_set_font_flags:
|
||||
* @flags: The new flags
|
||||
*
|
||||
* Sets the font quality options for subsequent text rendering
|
||||
* operations.
|
||||
*
|
||||
* Using mipmapped textures will improve the quality for scaled down
|
||||
* text but will use more texture memory.
|
||||
*
|
||||
* Enabling hinting improves text quality for static text but may
|
||||
* introduce some artifacts if the text is animated.
|
||||
*
|
||||
* Since: 1.0
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_backend_set_font_options() and the
|
||||
* #cairo_font_option_t API.
|
||||
*/
|
||||
void
|
||||
clutter_set_font_flags (ClutterFontFlags flags)
|
||||
{
|
||||
CoglPangoFontMap *font_map;
|
||||
ClutterFontFlags old_flags, changed_flags;
|
||||
const cairo_font_options_t *font_options;
|
||||
cairo_font_options_t *new_font_options;
|
||||
cairo_hint_style_t hint_style;
|
||||
gboolean use_mipmapping;
|
||||
ClutterBackend *backend;
|
||||
|
||||
backend = clutter_get_default_backend ();
|
||||
font_map = clutter_context_get_pango_fontmap ();
|
||||
font_options = clutter_backend_get_font_options (backend);
|
||||
old_flags = 0;
|
||||
|
||||
if (cogl_pango_font_map_get_use_mipmapping (font_map))
|
||||
old_flags |= CLUTTER_FONT_MIPMAPPING;
|
||||
|
||||
hint_style = cairo_font_options_get_hint_style (font_options);
|
||||
if (hint_style != CAIRO_HINT_STYLE_DEFAULT &&
|
||||
hint_style != CAIRO_HINT_STYLE_NONE)
|
||||
old_flags |= CLUTTER_FONT_HINTING;
|
||||
|
||||
if (old_flags == flags)
|
||||
return;
|
||||
|
||||
new_font_options = cairo_font_options_copy (font_options);
|
||||
|
||||
/* Only set the font options that have actually changed so we don't
|
||||
override a detailed setting from the backend */
|
||||
changed_flags = old_flags ^ flags;
|
||||
|
||||
if ((changed_flags & CLUTTER_FONT_MIPMAPPING))
|
||||
{
|
||||
use_mipmapping = (changed_flags & CLUTTER_FONT_MIPMAPPING) != 0;
|
||||
|
||||
cogl_pango_font_map_set_use_mipmapping (font_map, use_mipmapping);
|
||||
}
|
||||
|
||||
if ((changed_flags & CLUTTER_FONT_HINTING))
|
||||
{
|
||||
hint_style = (flags & CLUTTER_FONT_HINTING)
|
||||
? CAIRO_HINT_STYLE_FULL
|
||||
: CAIRO_HINT_STYLE_NONE;
|
||||
|
||||
cairo_font_options_set_hint_style (new_font_options, hint_style);
|
||||
}
|
||||
|
||||
clutter_backend_set_font_options (backend, new_font_options);
|
||||
|
||||
cairo_font_options_destroy (new_font_options);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_get_font_flags:
|
||||
*
|
||||
* Gets the current font flags for rendering text. See
|
||||
* clutter_set_font_flags().
|
||||
*
|
||||
* Return value: The font flags
|
||||
*
|
||||
* Since: 1.0
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_backend_get_font_options() and the
|
||||
* #cairo_font_options_t API.
|
||||
*/
|
||||
ClutterFontFlags
|
||||
clutter_get_font_flags (void)
|
||||
{
|
||||
CoglPangoFontMap *font_map = NULL;
|
||||
const cairo_font_options_t *font_options;
|
||||
ClutterFontFlags flags = 0;
|
||||
cairo_hint_style_t hint_style;
|
||||
|
||||
font_map = clutter_context_get_pango_fontmap ();
|
||||
if (cogl_pango_font_map_get_use_mipmapping (font_map))
|
||||
flags |= CLUTTER_FONT_MIPMAPPING;
|
||||
|
||||
font_options =
|
||||
clutter_backend_get_font_options (clutter_get_default_backend ());
|
||||
|
||||
hint_style = cairo_font_options_get_hint_style (font_options);
|
||||
if (hint_style != CAIRO_HINT_STYLE_DEFAULT &&
|
||||
hint_style != CAIRO_HINT_STYLE_NONE)
|
||||
flags |= CLUTTER_FONT_HINTING;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_get_input_device_for_id:
|
||||
* @id_: the unique id for a device
|
||||
*
|
||||
* Retrieves the #ClutterInputDevice from its @id_. This is a convenience
|
||||
* wrapper for clutter_device_manager_get_device() and it is functionally
|
||||
* equivalent to:
|
||||
*
|
||||
* |[
|
||||
* ClutterDeviceManager *manager;
|
||||
* ClutterInputDevice *device;
|
||||
*
|
||||
* manager = clutter_device_manager_get_default ();
|
||||
* device = clutter_device_manager_get_device (manager, id);
|
||||
* ]|
|
||||
*
|
||||
* Return value: (transfer none): a #ClutterInputDevice, or %NULL
|
||||
*
|
||||
* Since: 0.8
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_device_manager_get_device() instead.
|
||||
*/
|
||||
ClutterInputDevice *
|
||||
clutter_get_input_device_for_id (gint id_)
|
||||
{
|
||||
ClutterDeviceManager *manager;
|
||||
|
||||
manager = clutter_device_manager_get_default ();
|
||||
if (manager == NULL)
|
||||
return NULL;
|
||||
|
||||
return clutter_device_manager_get_device (manager, id_);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_get_font_map:
|
||||
*
|
||||
@@ -3577,43 +3040,6 @@ _clutter_context_get_pick_mode (void)
|
||||
return context->pick_mode;
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_context_push_shader_stack (ClutterActor *actor)
|
||||
{
|
||||
ClutterMainContext *context = _clutter_context_get_default ();
|
||||
|
||||
context->shaders = g_slist_prepend (context->shaders, actor);
|
||||
}
|
||||
|
||||
ClutterActor *
|
||||
_clutter_context_peek_shader_stack (void)
|
||||
{
|
||||
ClutterMainContext *context = _clutter_context_get_default ();
|
||||
|
||||
if (context->shaders != NULL)
|
||||
return context->shaders->data;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ClutterActor *
|
||||
_clutter_context_pop_shader_stack (ClutterActor *actor)
|
||||
{
|
||||
ClutterMainContext *context = _clutter_context_get_default ();
|
||||
|
||||
context->shaders = g_slist_remove (context->shaders, actor);
|
||||
|
||||
return _clutter_context_peek_shader_stack ();
|
||||
}
|
||||
|
||||
gboolean
|
||||
_clutter_context_get_motion_events_enabled (void)
|
||||
{
|
||||
ClutterMainContext *context = _clutter_context_get_default ();
|
||||
|
||||
return context->motion_events_per_actor;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_check_windowing_backend:
|
||||
* @backend_type: the name of the backend to check
|
||||
|
@@ -117,9 +117,6 @@ void clutter_disable_accessibility (void);
|
||||
|
||||
/* Threading functions */
|
||||
CLUTTER_EXPORT
|
||||
void clutter_threads_set_lock_functions (GCallback enter_fn,
|
||||
GCallback leave_fn);
|
||||
CLUTTER_EXPORT
|
||||
guint clutter_threads_add_idle (GSourceFunc func,
|
||||
gpointer data);
|
||||
CLUTTER_EXPORT
|
||||
|
@@ -146,9 +146,6 @@ struct _ClutterMainContext
|
||||
ClutterActor *pointer_grab_actor;
|
||||
ClutterActor *keyboard_grab_actor;
|
||||
|
||||
/* stack of actors with shaders during paint */
|
||||
GSList *shaders;
|
||||
|
||||
/* fb bit masks for col<->id mapping in picking */
|
||||
gint fb_r_mask;
|
||||
gint fb_g_mask;
|
||||
@@ -173,7 +170,6 @@ struct _ClutterMainContext
|
||||
|
||||
/* boolean flags */
|
||||
guint is_initialized : 1;
|
||||
guint motion_events_per_actor : 1;
|
||||
guint defer_display_setup : 1;
|
||||
guint options_parsed : 1;
|
||||
guint show_fps : 1;
|
||||
@@ -198,10 +194,6 @@ void _clutter_context_lock (void);
|
||||
void _clutter_context_unlock (void);
|
||||
gboolean _clutter_context_is_initialized (void);
|
||||
ClutterPickMode _clutter_context_get_pick_mode (void);
|
||||
void _clutter_context_push_shader_stack (ClutterActor *actor);
|
||||
ClutterActor * _clutter_context_pop_shader_stack (ClutterActor *actor);
|
||||
ClutterActor * _clutter_context_peek_shader_stack (void);
|
||||
gboolean _clutter_context_get_motion_events_enabled (void);
|
||||
gboolean _clutter_context_get_show_fps (void);
|
||||
|
||||
gboolean _clutter_feature_init (GError **error);
|
||||
|
@@ -1636,14 +1636,17 @@ clutter_script_translate_parameters (ClutterScript *script,
|
||||
GObject *object,
|
||||
const gchar *name,
|
||||
GList *properties,
|
||||
GArray **params)
|
||||
GPtrArray **param_names,
|
||||
GArray **param_values)
|
||||
{
|
||||
ClutterScriptable *scriptable = NULL;
|
||||
ClutterScriptableIface *iface = NULL;
|
||||
GList *l, *unparsed;
|
||||
gboolean parse_custom = FALSE;
|
||||
|
||||
*params = g_array_new (FALSE, FALSE, sizeof (GParameter));
|
||||
*param_names = g_ptr_array_new_with_free_func (g_free);
|
||||
*param_values = g_array_new (FALSE, FALSE, sizeof (GValue));
|
||||
g_array_set_clear_func (*param_values, (GDestroyNotify) g_value_unset);
|
||||
|
||||
if (CLUTTER_IS_SCRIPTABLE (object))
|
||||
{
|
||||
@@ -1659,7 +1662,7 @@ clutter_script_translate_parameters (ClutterScript *script,
|
||||
for (l = properties; l != NULL; l = l->next)
|
||||
{
|
||||
PropertyInfo *pinfo = l->data;
|
||||
GParameter param = { NULL };
|
||||
GValue value = G_VALUE_INIT;
|
||||
gboolean res = FALSE;
|
||||
|
||||
if (pinfo->is_child || pinfo->is_layout)
|
||||
@@ -1676,12 +1679,12 @@ clutter_script_translate_parameters (ClutterScript *script,
|
||||
pinfo->name);
|
||||
|
||||
if (parse_custom)
|
||||
res = iface->parse_custom_node (scriptable, script, ¶m.value,
|
||||
res = iface->parse_custom_node (scriptable, script, &value,
|
||||
pinfo->name,
|
||||
pinfo->node);
|
||||
|
||||
if (!res)
|
||||
res = _clutter_script_parse_node (script, ¶m.value,
|
||||
res = _clutter_script_parse_node (script, &value,
|
||||
pinfo->name,
|
||||
pinfo->node,
|
||||
pinfo->pspec);
|
||||
@@ -1693,9 +1696,8 @@ clutter_script_translate_parameters (ClutterScript *script,
|
||||
continue;
|
||||
}
|
||||
|
||||
param.name = g_strdup (pinfo->name);
|
||||
|
||||
g_array_append_val (*params, param);
|
||||
g_ptr_array_add (*param_names, g_strdup (pinfo->name));
|
||||
g_array_append_val (*param_values, value);
|
||||
|
||||
property_info_free (pinfo);
|
||||
}
|
||||
@@ -1710,7 +1712,8 @@ clutter_script_construct_parameters (ClutterScript *script,
|
||||
GType gtype,
|
||||
const gchar *name,
|
||||
GList *properties,
|
||||
GArray **construct_params)
|
||||
GPtrArray **construct_param_names,
|
||||
GArray **construct_param_values)
|
||||
{
|
||||
GObjectClass *klass;
|
||||
GList *l, *unparsed;
|
||||
@@ -1718,14 +1721,17 @@ clutter_script_construct_parameters (ClutterScript *script,
|
||||
klass = g_type_class_ref (gtype);
|
||||
g_assert (klass != NULL);
|
||||
|
||||
*construct_params = g_array_new (FALSE, FALSE, sizeof (GParameter));
|
||||
*construct_param_names = g_ptr_array_new_with_free_func (g_free);
|
||||
*construct_param_values = g_array_new (FALSE, FALSE, sizeof (GValue));
|
||||
g_array_set_clear_func (*construct_param_values,
|
||||
(GDestroyNotify) g_value_unset);
|
||||
|
||||
unparsed = NULL;
|
||||
|
||||
for (l = properties; l != NULL; l = l->next)
|
||||
{
|
||||
PropertyInfo *pinfo = l->data;
|
||||
GParameter param = { NULL };
|
||||
GValue value = G_VALUE_INIT;
|
||||
GParamSpec *pspec = NULL;
|
||||
|
||||
/* we allow custom property names for classes, so if we
|
||||
@@ -1749,9 +1755,7 @@ clutter_script_construct_parameters (ClutterScript *script,
|
||||
continue;
|
||||
}
|
||||
|
||||
param.name = g_strdup (pinfo->name);
|
||||
|
||||
if (!_clutter_script_parse_node (script, ¶m.value,
|
||||
if (!_clutter_script_parse_node (script, &value,
|
||||
pinfo->name,
|
||||
pinfo->node,
|
||||
pinfo->pspec))
|
||||
@@ -1760,7 +1764,8 @@ clutter_script_construct_parameters (ClutterScript *script,
|
||||
continue;
|
||||
}
|
||||
|
||||
g_array_append_val (*construct_params, param);
|
||||
g_ptr_array_add (*construct_param_names, g_strdup (pinfo->name));
|
||||
g_array_append_val (*construct_param_values, value);
|
||||
|
||||
property_info_free (pinfo);
|
||||
}
|
||||
@@ -2087,7 +2092,8 @@ _clutter_script_apply_properties (ClutterScript *script,
|
||||
gboolean set_custom_property = FALSE;
|
||||
GObject *object = oinfo->object;
|
||||
GList *properties;
|
||||
GArray *params;
|
||||
g_autoptr (GPtrArray) param_names = NULL;
|
||||
g_autoptr (GArray) param_values = NULL;
|
||||
guint i;
|
||||
|
||||
if (!oinfo->has_unresolved)
|
||||
@@ -2111,34 +2117,31 @@ _clutter_script_apply_properties (ClutterScript *script,
|
||||
object,
|
||||
oinfo->id,
|
||||
properties,
|
||||
¶ms);
|
||||
¶m_names,
|
||||
¶m_values);
|
||||
|
||||
/* consume all the properties we could translate in this pass */
|
||||
for (i = 0; i < params->len; i++)
|
||||
for (i = 0; i < param_names->len; i++)
|
||||
{
|
||||
GParameter *param = &g_array_index (params, GParameter, i);
|
||||
char *name = g_ptr_array_index (param_names, i);
|
||||
GValue *value = &g_array_index (param_values, GValue, i);
|
||||
|
||||
CLUTTER_NOTE (SCRIPT,
|
||||
"Setting %s property '%s' (type:%s) to object '%s' (id:%s)",
|
||||
set_custom_property ? "custom" : "regular",
|
||||
param->name,
|
||||
g_type_name (G_VALUE_TYPE (¶m->value)),
|
||||
name,
|
||||
g_type_name (G_VALUE_TYPE (value)),
|
||||
g_type_name (oinfo->gtype),
|
||||
oinfo->id);
|
||||
|
||||
if (set_custom_property)
|
||||
iface->set_custom_property (scriptable, script,
|
||||
param->name,
|
||||
¶m->value);
|
||||
name,
|
||||
value);
|
||||
else
|
||||
g_object_set_property (object, param->name, ¶m->value);
|
||||
|
||||
g_free ((gchar *) param->name);
|
||||
g_value_unset (¶m->value);
|
||||
g_object_set_property (object, name, value);
|
||||
}
|
||||
|
||||
g_array_free (params, TRUE);
|
||||
|
||||
_clutter_script_check_unresolved (script, oinfo);
|
||||
}
|
||||
|
||||
@@ -2146,8 +2149,8 @@ void
|
||||
_clutter_script_construct_object (ClutterScript *script,
|
||||
ObjectInfo *oinfo)
|
||||
{
|
||||
GArray *params = NULL;
|
||||
guint i;
|
||||
g_autoptr (GPtrArray) param_names = NULL;
|
||||
g_autoptr (GArray) param_values = NULL;
|
||||
|
||||
/* we have completely updated the object */
|
||||
if (oinfo->object != NULL)
|
||||
@@ -2190,25 +2193,14 @@ _clutter_script_construct_object (ClutterScript *script,
|
||||
oinfo->gtype,
|
||||
oinfo->id,
|
||||
properties,
|
||||
¶ms);
|
||||
¶m_names,
|
||||
¶m_values);
|
||||
|
||||
default_stage = clutter_stage_manager_get_default_stage (manager);
|
||||
oinfo->object = G_OBJECT (default_stage);
|
||||
|
||||
for (i = 0; i < params->len; i++)
|
||||
{
|
||||
GParameter *param = &g_array_index (params, GParameter, i);
|
||||
|
||||
g_free ((gchar *) param->name);
|
||||
g_value_unset (¶m->value);
|
||||
}
|
||||
|
||||
g_array_free (params, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_autoptr (GPtrArray) param_names = NULL;
|
||||
GArray *param_values;
|
||||
GList *properties = oinfo->properties;
|
||||
|
||||
/* every other object: first, we get the construction parameters */
|
||||
@@ -2217,22 +2209,11 @@ _clutter_script_construct_object (ClutterScript *script,
|
||||
oinfo->gtype,
|
||||
oinfo->id,
|
||||
properties,
|
||||
¶ms);
|
||||
|
||||
/* Convert GParameter → (GStrv, GValue[]) */
|
||||
param_names = g_ptr_array_sized_new (params->len);
|
||||
param_values = g_array_sized_new (TRUE, FALSE, sizeof (GValue), params->len);
|
||||
for (i = 0; i < params->len; i++)
|
||||
{
|
||||
GParameter *param = &g_array_index (params, GParameter, i);
|
||||
|
||||
g_ptr_array_add (param_names, (gchar *) param->name);
|
||||
g_array_append_val (param_values, param->value);
|
||||
}
|
||||
g_ptr_array_add (param_names, NULL);
|
||||
¶m_names,
|
||||
¶m_values);
|
||||
|
||||
oinfo->object = g_object_new_with_properties (oinfo->gtype,
|
||||
params->len,
|
||||
param_names->len,
|
||||
(const gchar **) param_names->pdata,
|
||||
(const GValue *) param_values->data);
|
||||
|
||||
@@ -2241,17 +2222,6 @@ _clutter_script_construct_object (ClutterScript *script,
|
||||
* else too or only by this ClutterScript object.
|
||||
*/
|
||||
g_object_ref_sink (oinfo->object);
|
||||
|
||||
for (i = 0; i < params->len; i++)
|
||||
{
|
||||
GParameter *param = &g_array_index (params, GParameter, i);
|
||||
|
||||
g_free ((gchar *) param->name);
|
||||
g_value_unset (¶m->value);
|
||||
}
|
||||
|
||||
g_array_free (param_values, FALSE);
|
||||
g_array_free (params, TRUE);
|
||||
}
|
||||
|
||||
g_assert (oinfo->object != NULL);
|
||||
|
@@ -263,8 +263,6 @@ enum
|
||||
|
||||
static GParamSpec *obj_props[PROP_LAST];
|
||||
|
||||
#define CLUTTER_SCRIPT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_SCRIPT, ClutterScriptPrivate))
|
||||
|
||||
struct _ClutterScriptPrivate
|
||||
{
|
||||
GHashTable *objects;
|
||||
@@ -377,7 +375,7 @@ object_info_free (gpointer data)
|
||||
static void
|
||||
clutter_script_finalize (GObject *gobject)
|
||||
{
|
||||
ClutterScriptPrivate *priv = CLUTTER_SCRIPT_GET_PRIVATE (gobject);
|
||||
ClutterScriptPrivate *priv = CLUTTER_SCRIPT (gobject)->priv;
|
||||
|
||||
g_object_unref (priv->parser);
|
||||
g_hash_table_destroy (priv->objects);
|
||||
|
@@ -2240,14 +2240,7 @@ clutter_stage_init (ClutterStage *self)
|
||||
priv->throttle_motion_events = TRUE;
|
||||
priv->min_size_changed = FALSE;
|
||||
priv->sync_delay = -1;
|
||||
|
||||
/* XXX - we need to keep the invariant that calling
|
||||
* clutter_set_motion_event_enabled() before the stage creation
|
||||
* will cause motion event delivery to be disabled on any newly
|
||||
* created stage. this can go away when we break API and remove
|
||||
* deprecated functions.
|
||||
*/
|
||||
priv->motion_events_enabled = _clutter_context_get_motion_events_enabled ();
|
||||
priv->motion_events_enabled = TRUE;
|
||||
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (self),
|
||||
&default_stage_color);
|
||||
|
@@ -171,7 +171,7 @@ clutter_text_buffer_normal_insert_text (ClutterTextBuffer *buffer,
|
||||
|
||||
/* Actual text insertion */
|
||||
at = g_utf8_offset_to_pointer (pv->normal_text, position) - pv->normal_text;
|
||||
g_memmove (pv->normal_text + at + n_bytes, pv->normal_text + at, pv->normal_text_bytes - at);
|
||||
memmove (pv->normal_text + at + n_bytes, pv->normal_text + at, pv->normal_text_bytes - at);
|
||||
memcpy (pv->normal_text + at, chars, n_bytes);
|
||||
|
||||
/* Book keeping */
|
||||
@@ -201,7 +201,7 @@ clutter_text_buffer_normal_delete_text (ClutterTextBuffer *buffer,
|
||||
start = g_utf8_offset_to_pointer (pv->normal_text, position) - pv->normal_text;
|
||||
end = g_utf8_offset_to_pointer (pv->normal_text, position + n_chars) - pv->normal_text;
|
||||
|
||||
g_memmove (pv->normal_text + start, pv->normal_text + end, pv->normal_text_bytes + 1 - end);
|
||||
memmove (pv->normal_text + start, pv->normal_text + end, pv->normal_text_bytes + 1 - end);
|
||||
pv->normal_text_chars -= n_chars;
|
||||
pv->normal_text_bytes -= (end - start);
|
||||
|
||||
|
@@ -1,85 +0,0 @@
|
||||
/*
|
||||
* Clutter.
|
||||
*
|
||||
* An OpenGL based 'interactive canvas' library.
|
||||
*
|
||||
* Copyright (C) 2011 Intel Corp
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
|
||||
#error "Only <clutter/clutter.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __CLUTTER_MAIN_DEPRECATED_H__
|
||||
#define __CLUTTER_MAIN_DEPRECATED_H__
|
||||
|
||||
#include <clutter/clutter-types.h>
|
||||
#include <clutter/clutter-input-device.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_threads_init (void);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_threads_enter (void);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_threads_leave (void);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_stage_set_motion_events_enabled)
|
||||
void clutter_set_motion_events_enabled (gboolean enable);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_stage_get_motion_events_enabled)
|
||||
gboolean clutter_get_motion_events_enabled (void);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_stage_ensure_redraw)
|
||||
void clutter_redraw (ClutterStage *stage);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(cogl_pango_font_map_clear_glyph_cache)
|
||||
void clutter_clear_glyph_cache (void);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_backend_set_font_options)
|
||||
void clutter_set_font_flags (ClutterFontFlags flags);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_backend_get_font_options)
|
||||
ClutterFontFlags clutter_get_font_flags (void);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_device_manager_get_device)
|
||||
ClutterInputDevice * clutter_get_input_device_for_id (gint id_);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_input_device_grab)
|
||||
void clutter_grab_pointer_for_device (ClutterActor *actor,
|
||||
gint id_);
|
||||
|
||||
CLUTTER_DEPRECATED_FOR(clutter_input_device_ungrab)
|
||||
void clutter_ungrab_pointer_for_device (gint id_);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_set_default_frame_rate (guint frames_per_sec);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
gulong clutter_get_timestamp (void);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
gboolean clutter_get_debug_enabled (void);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
gboolean clutter_get_show_fps (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_MAIN_DEPRECATED_H__ */
|
@@ -234,7 +234,6 @@ clutter_deprecated_headers = [
|
||||
'deprecated/clutter-container.h',
|
||||
'deprecated/clutter-group.h',
|
||||
'deprecated/clutter-keysyms.h',
|
||||
'deprecated/clutter-main.h',
|
||||
'deprecated/clutter-rectangle.h',
|
||||
'deprecated/clutter-stage-manager.h',
|
||||
'deprecated/clutter-stage.h',
|
||||
|
@@ -13,7 +13,7 @@ G_BEGIN_DECLS
|
||||
|
||||
#define TEST_COGLBOX(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
||||
TEST_TYPE_COGLBOX, TestCoglboxClass))
|
||||
TEST_TYPE_COGLBOX, TestCoglbox))
|
||||
|
||||
#define TEST_COGLBOX_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), \
|
||||
@@ -77,7 +77,7 @@ struct _TestCoglboxPrivate
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
|
||||
|
||||
#define TEST_COGLBOX_GET_PRIVATE(obj) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
|
||||
(test_coglbox_get_instance_private (TEST_COGLBOX ((obj))))
|
||||
|
||||
/* Coglbox implementation
|
||||
*--------------------------------------------------*/
|
||||
|
@@ -13,7 +13,7 @@ G_BEGIN_DECLS
|
||||
|
||||
#define TEST_COGLBOX(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
||||
TEST_TYPE_COGLBOX, TestCoglboxClass))
|
||||
TEST_TYPE_COGLBOX, TestCoglbox))
|
||||
|
||||
#define TEST_COGLBOX_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), \
|
||||
@@ -76,7 +76,7 @@ struct _TestCoglboxPrivate
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
|
||||
|
||||
#define TEST_COGLBOX_GET_PRIVATE(obj) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
|
||||
(test_coglbox_get_instance_private (TEST_COGLBOX ((obj))))
|
||||
|
||||
/* Coglbox implementation
|
||||
*--------------------------------------------------*/
|
||||
|
@@ -13,7 +13,7 @@ G_BEGIN_DECLS
|
||||
|
||||
#define TEST_COGLBOX(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
||||
TEST_TYPE_COGLBOX, TestCoglboxClass))
|
||||
TEST_TYPE_COGLBOX, TestCoglbox))
|
||||
|
||||
#define TEST_COGLBOX_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), \
|
||||
@@ -78,7 +78,7 @@ struct _TestCoglboxPrivate
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
|
||||
|
||||
#define TEST_COGLBOX_GET_PRIVATE(obj) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
|
||||
((TestCoglboxPrivate *)test_coglbox_get_instance_private (TEST_COGLBOX ((obj))))
|
||||
|
||||
/* Coglbox implementation
|
||||
*--------------------------------------------------*/
|
||||
|
@@ -14,7 +14,7 @@ G_BEGIN_DECLS
|
||||
|
||||
#define TEST_COGLBOX(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
||||
TEST_TYPE_COGLBOX, TestCoglboxClass))
|
||||
TEST_TYPE_COGLBOX, TestCoglbox))
|
||||
|
||||
#define TEST_COGLBOX_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), \
|
||||
@@ -77,7 +77,7 @@ struct _TestCoglboxPrivate
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
|
||||
|
||||
#define TEST_COGLBOX_GET_PRIVATE(obj) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
|
||||
(test_coglbox_get_instance_private (TEST_COGLBOX ((obj))))
|
||||
|
||||
/* Coglbox implementation
|
||||
*--------------------------------------------------*/
|
||||
|
@@ -146,9 +146,7 @@ test_texture_async_main (int argc, char *argv[])
|
||||
task, path,
|
||||
cleanup_task);
|
||||
|
||||
clutter_threads_enter ();
|
||||
clutter_main ();
|
||||
clutter_threads_leave ();
|
||||
|
||||
g_free (path);
|
||||
|
||||
|
@@ -39,6 +39,13 @@
|
||||
#define PANGO_ENABLE_BACKEND 1
|
||||
#endif
|
||||
|
||||
#ifndef PANGO_UNKNOWN_GLYPH_WIDTH
|
||||
#define PANGO_UNKNOWN_GLYPH_WIDTH 10
|
||||
#endif
|
||||
#ifndef PANGO_UNKNOWN_GLYPH_HEIGHT
|
||||
#define PANGO_UNKNOWN_GLYPH_HEIGHT 14
|
||||
#endif
|
||||
|
||||
#include <pango/pango-fontmap.h>
|
||||
#include <pango/pangocairo.h>
|
||||
#include <pango/pango-renderer.h>
|
||||
|
@@ -4,6 +4,7 @@
|
||||
* A Low Level GPU Graphics and Utilities API
|
||||
*
|
||||
* Copyright (C) 2011 Intel Corporation.
|
||||
* Copyright (C) 2019 DisplayLink (UK) Ltd.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
@@ -152,11 +153,12 @@ _cogl_blit_framebuffer_begin (CoglBlitData *data)
|
||||
CoglFramebuffer *dst_fb, *src_fb;
|
||||
GError *ignore_error = NULL;
|
||||
|
||||
/* We can only blit between FBOs if both textures are the same
|
||||
format and the blit framebuffer extension is supported */
|
||||
if ((_cogl_texture_get_format (data->src_tex) & ~COGL_A_BIT) !=
|
||||
(_cogl_texture_get_format (data->dst_tex) & ~COGL_A_BIT) ||
|
||||
!_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT))
|
||||
/* We can only blit between FBOs if both textures have the same
|
||||
premult convention and the blit framebuffer extension is
|
||||
supported. */
|
||||
if ((_cogl_texture_get_format (data->src_tex) & COGL_PREMULT_BIT) !=
|
||||
(_cogl_texture_get_format (data->dst_tex) & COGL_PREMULT_BIT) ||
|
||||
!_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_BLIT_FRAMEBUFFER))
|
||||
return FALSE;
|
||||
|
||||
dst_offscreen = _cogl_offscreen_new_with_texture_full
|
||||
@@ -205,11 +207,12 @@ _cogl_blit_framebuffer_blit (CoglBlitData *data,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
_cogl_blit_framebuffer (data->src_fb,
|
||||
data->dest_fb,
|
||||
src_x, src_y,
|
||||
dst_x, dst_y,
|
||||
width, height);
|
||||
cogl_blit_framebuffer (data->src_fb,
|
||||
data->dest_fb,
|
||||
src_x, src_y,
|
||||
dst_x, dst_y,
|
||||
width, height,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -4,6 +4,7 @@
|
||||
* A Low Level GPU Graphics and Utilities API
|
||||
*
|
||||
* Copyright (C) 2007,2008,2009 Intel Corporation.
|
||||
* Copyright (C) 2019 DisplayLink (UK) Ltd.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
@@ -363,63 +364,6 @@ void
|
||||
_cogl_push_framebuffers (CoglFramebuffer *draw_buffer,
|
||||
CoglFramebuffer *read_buffer);
|
||||
|
||||
/*
|
||||
* _cogl_blit_framebuffer:
|
||||
* @src: The source #CoglFramebuffer
|
||||
* @dest: The destination #CoglFramebuffer
|
||||
* @src_x: Source x position
|
||||
* @src_y: Source y position
|
||||
* @dst_x: Destination x position
|
||||
* @dst_y: Destination y position
|
||||
* @width: Width of region to copy
|
||||
* @height: Height of region to copy
|
||||
*
|
||||
* This blits a region of the color buffer of the current draw buffer
|
||||
* to the current read buffer. The draw and read buffers can be set up
|
||||
* using _cogl_push_framebuffers(). This function should only be
|
||||
* called if the COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT feature is
|
||||
* advertised. The two buffers must both be offscreen and have the
|
||||
* same format.
|
||||
*
|
||||
* Note that this function differs a lot from the glBlitFramebuffer
|
||||
* function provided by the GL_EXT_framebuffer_blit extension. Notably
|
||||
* it doesn't support having different sizes for the source and
|
||||
* destination rectangle. This isn't supported by the corresponding
|
||||
* GL_ANGLE_framebuffer_blit extension on GLES2.0 and it doesn't seem
|
||||
* like a particularly useful feature. If the application wanted to
|
||||
* scale the results it may make more sense to draw a primitive
|
||||
* instead.
|
||||
*
|
||||
* We can only really support blitting between two offscreen buffers
|
||||
* for this function on GLES2.0. This is because we effectively render
|
||||
* upside down to offscreen buffers to maintain Cogl's representation
|
||||
* of the texture coordinate system where 0,0 is the top left of the
|
||||
* texture. If we were to blit from an offscreen to an onscreen buffer
|
||||
* then we would need to mirror the blit along the x-axis but the GLES
|
||||
* extension does not support this.
|
||||
*
|
||||
* The GL function is documented to be affected by the scissor. This
|
||||
* function therefore ensure that an empty clip stack is flushed
|
||||
* before performing the blit which means the scissor is effectively
|
||||
* ignored.
|
||||
*
|
||||
* The function also doesn't support specifying the buffers to copy
|
||||
* and instead only the color buffer is copied. When copying the depth
|
||||
* or stencil buffers the extension on GLES2.0 only supports copying
|
||||
* the full buffer which would be awkward to document with this
|
||||
* API. If we wanted to support that feature it may be better to have
|
||||
* a separate function to copy the entire buffer for a given mask.
|
||||
*/
|
||||
void
|
||||
_cogl_blit_framebuffer (CoglFramebuffer *src,
|
||||
CoglFramebuffer *dest,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dst_x,
|
||||
int dst_y,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
void
|
||||
_cogl_framebuffer_push_projection (CoglFramebuffer *framebuffer);
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
* A Low Level GPU Graphics and Utilities API
|
||||
*
|
||||
* Copyright (C) 2007,2008,2009,2012 Intel Corporation.
|
||||
* Copyright (C) 2019 DisplayLink (UK) Ltd.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
@@ -1340,28 +1341,38 @@ cogl_framebuffer_read_pixels (CoglFramebuffer *framebuffer,
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
_cogl_blit_framebuffer (CoglFramebuffer *src,
|
||||
CoglFramebuffer *dest,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dst_x,
|
||||
int dst_y,
|
||||
int width,
|
||||
int height)
|
||||
gboolean
|
||||
cogl_blit_framebuffer (CoglFramebuffer *src,
|
||||
CoglFramebuffer *dest,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dst_x,
|
||||
int dst_y,
|
||||
int width,
|
||||
int height,
|
||||
GError **error)
|
||||
{
|
||||
CoglContext *ctx = src->context;
|
||||
int src_x1, src_y1, src_x2, src_y2;
|
||||
int dst_x1, dst_y1, dst_x2, dst_y2;
|
||||
|
||||
g_return_if_fail (_cogl_has_private_feature
|
||||
(ctx, COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT));
|
||||
if (!_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_BLIT_FRAMEBUFFER))
|
||||
{
|
||||
g_set_error_literal (error, COGL_SYSTEM_ERROR,
|
||||
COGL_SYSTEM_ERROR_UNSUPPORTED,
|
||||
"Cogl BLIT_FRAMEBUFFER is not supported by the system.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* We can only support blitting between offscreen buffers because
|
||||
otherwise we would need to mirror the image and GLES2.0 doesn't
|
||||
support this */
|
||||
g_return_if_fail (cogl_is_offscreen (src));
|
||||
g_return_if_fail (cogl_is_offscreen (dest));
|
||||
/* The buffers must be the same format */
|
||||
g_return_if_fail (src->internal_format == dest->internal_format);
|
||||
/* The buffers must use the same premult convention */
|
||||
if ((src->internal_format & COGL_PREMULT_BIT) !=
|
||||
(dest->internal_format & COGL_PREMULT_BIT))
|
||||
{
|
||||
g_set_error_literal (error, COGL_SYSTEM_ERROR,
|
||||
COGL_SYSTEM_ERROR_UNSUPPORTED,
|
||||
"cogl_blit_framebuffer premult mismatch.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Make sure the current framebuffers are bound. We explicitly avoid
|
||||
flushing the clip state so we can bind our own empty state */
|
||||
@@ -1382,12 +1393,45 @@ _cogl_blit_framebuffer (CoglFramebuffer *src,
|
||||
* as changed */
|
||||
ctx->current_draw_buffer_changes |= COGL_FRAMEBUFFER_STATE_CLIP;
|
||||
|
||||
ctx->glBlitFramebuffer (src_x, src_y,
|
||||
src_x + width, src_y + height,
|
||||
dst_x, dst_y,
|
||||
dst_x + width, dst_y + height,
|
||||
/* Offscreens we do the normal way, onscreens need an y-flip. Even if
|
||||
* we consider offscreens to be rendered upside-down, the offscreen
|
||||
* orientation is in this function's API. */
|
||||
if (cogl_is_offscreen (src))
|
||||
{
|
||||
src_x1 = src_x;
|
||||
src_y1 = src_y;
|
||||
src_x2 = src_x + width;
|
||||
src_y2 = src_y + height;
|
||||
}
|
||||
else
|
||||
{
|
||||
src_x1 = src_x;
|
||||
src_y1 = cogl_framebuffer_get_height (src) - src_y;
|
||||
src_x2 = src_x + width;
|
||||
src_y2 = src_y1 - height;
|
||||
}
|
||||
|
||||
if (cogl_is_offscreen (dest))
|
||||
{
|
||||
dst_x1 = dst_x;
|
||||
dst_y1 = dst_y;
|
||||
dst_x2 = dst_x + width;
|
||||
dst_y2 = dst_y + height;
|
||||
}
|
||||
else
|
||||
{
|
||||
dst_x1 = dst_x;
|
||||
dst_y1 = cogl_framebuffer_get_height (dest) - dst_y;
|
||||
dst_x2 = dst_x + width;
|
||||
dst_y2 = dst_y1 - height;
|
||||
}
|
||||
|
||||
ctx->glBlitFramebuffer (src_x1, src_y1, src_x2, src_y2,
|
||||
dst_x1, dst_y1, dst_x2, dst_y2,
|
||||
GL_COLOR_BUFFER_BIT,
|
||||
GL_NEAREST);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -3,7 +3,8 @@
|
||||
*
|
||||
* A Low Level GPU Graphics and Utilities API
|
||||
*
|
||||
* Copyright (C) 2011 Intel Corporation.
|
||||
* Copyright (C) 2007,2008,2009,2011 Intel Corporation.
|
||||
* Copyright (C) 2019 DisplayLink (UK) Ltd.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
@@ -1797,6 +1798,69 @@ typedef enum /*< prefix=COGL_FRAMEBUFFER_ERROR >*/
|
||||
gboolean
|
||||
cogl_is_framebuffer (void *object);
|
||||
|
||||
/**
|
||||
* cogl_blit_framebuffer:
|
||||
* @src: The source #CoglFramebuffer
|
||||
* @dest: The destination #CoglFramebuffer
|
||||
* @src_x: Source x position
|
||||
* @src_y: Source y position
|
||||
* @dst_x: Destination x position
|
||||
* @dst_y: Destination y position
|
||||
* @width: Width of region to copy
|
||||
* @height: Height of region to copy
|
||||
* @error: optional error object
|
||||
*
|
||||
* @return FALSE for an immediately detected error, TRUE otherwise.
|
||||
*
|
||||
* This blits a region of the color buffer of the source buffer
|
||||
* to the destination buffer. This function should only be
|
||||
* called if the COGL_PRIVATE_FEATURE_BLIT_FRAMEBUFFER feature is
|
||||
* advertised.
|
||||
*
|
||||
* The source and destination rectangles are defined in offscreen
|
||||
* framebuffer orientation. When copying between an offscreen and
|
||||
* onscreen framebuffers, the image is y-flipped accordingly.
|
||||
*
|
||||
* The two buffers must have the same value types (e.g. floating-point,
|
||||
* unsigned int, signed int, or fixed-point), but color formats do not
|
||||
* need to match. This limitation comes from OpenGL ES 3.0 definition
|
||||
* of glBlitFramebuffer.
|
||||
*
|
||||
* Note that this function differs a lot from the glBlitFramebuffer
|
||||
* function provided by the GL_EXT_framebuffer_blit extension. Notably
|
||||
* it doesn't support having different sizes for the source and
|
||||
* destination rectangle. This doesn't seem
|
||||
* like a particularly useful feature. If the application wanted to
|
||||
* scale the results it may make more sense to draw a primitive
|
||||
* instead.
|
||||
*
|
||||
* The GL function is documented to be affected by the scissor. This
|
||||
* function therefore ensure that an empty clip stack is flushed
|
||||
* before performing the blit which means the scissor is effectively
|
||||
* ignored.
|
||||
*
|
||||
* The function also doesn't support specifying the buffers to copy
|
||||
* and instead only the color buffer is copied. When copying the depth
|
||||
* or stencil buffers the extension on GLES2.0 only supports copying
|
||||
* the full buffer which would be awkward to document with this
|
||||
* API. If we wanted to support that feature it may be better to have
|
||||
* a separate function to copy the entire buffer for a given mask.
|
||||
*
|
||||
* The @c error argument is optional, it can be NULL. If it is not NULL
|
||||
* and this function returns FALSE, an error object with a code from
|
||||
* COGL_SYSTEM_ERROR will be created.
|
||||
*/
|
||||
gboolean
|
||||
cogl_blit_framebuffer (CoglFramebuffer *src,
|
||||
CoglFramebuffer *dest,
|
||||
int src_x,
|
||||
int src_y,
|
||||
int dst_x,
|
||||
int dst_y,
|
||||
int width,
|
||||
int height,
|
||||
GError **error);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __COGL_FRAMEBUFFER_H */
|
||||
|
@@ -42,7 +42,7 @@ typedef enum
|
||||
{
|
||||
COGL_PRIVATE_FEATURE_TEXTURE_2D_FROM_EGL_IMAGE,
|
||||
COGL_PRIVATE_FEATURE_MESA_PACK_INVERT,
|
||||
COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT,
|
||||
COGL_PRIVATE_FEATURE_BLIT_FRAMEBUFFER,
|
||||
COGL_PRIVATE_FEATURE_FOUR_CLIP_PLANES,
|
||||
COGL_PRIVATE_FEATURE_PBOS,
|
||||
COGL_PRIVATE_FEATURE_VBOS,
|
||||
|
@@ -47,6 +47,7 @@ struct _CoglTexture2D
|
||||
gboolean auto_mipmap;
|
||||
gboolean mipmaps_dirty;
|
||||
gboolean is_foreign;
|
||||
gboolean is_get_data_supported;
|
||||
|
||||
/* TODO: factor out these OpenGL specific members into some form
|
||||
* of driver private state. */
|
||||
|
@@ -106,6 +106,7 @@ _cogl_texture_2d_create_base (CoglContext *ctx,
|
||||
|
||||
tex_2d->mipmaps_dirty = TRUE;
|
||||
tex_2d->auto_mipmap = TRUE;
|
||||
tex_2d->is_get_data_supported = TRUE;
|
||||
|
||||
tex_2d->gl_target = GL_TEXTURE_2D;
|
||||
|
||||
@@ -240,6 +241,7 @@ cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
|
||||
int height,
|
||||
CoglPixelFormat format,
|
||||
EGLImageKHR image,
|
||||
CoglEglImageFlags flags,
|
||||
GError **error)
|
||||
{
|
||||
CoglTextureLoader *loader;
|
||||
@@ -260,6 +262,7 @@ cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
|
||||
loader->src.egl_image.width = width;
|
||||
loader->src.egl_image.height = height;
|
||||
loader->src.egl_image.format = format;
|
||||
loader->src.egl_image.flags = flags;
|
||||
|
||||
tex = _cogl_texture_2d_create_base (ctx, width, height, format, loader);
|
||||
|
||||
|
@@ -60,6 +60,12 @@ G_BEGIN_DECLS
|
||||
typedef struct _CoglTexture2D CoglTexture2D;
|
||||
#define COGL_TEXTURE_2D(X) ((CoglTexture2D *)X)
|
||||
|
||||
typedef enum _CoglEglImageFlags
|
||||
{
|
||||
COGL_EGL_IMAGE_FLAG_NONE = 0,
|
||||
COGL_EGL_IMAGE_FLAG_NO_GET_DATA = 1 << 0,
|
||||
} CoglEglImageFlags;
|
||||
|
||||
/**
|
||||
* cogl_texture_2d_get_gtype:
|
||||
*
|
||||
@@ -219,6 +225,7 @@ cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
|
||||
int height,
|
||||
CoglPixelFormat format,
|
||||
EGLImageKHR image,
|
||||
CoglEglImageFlags flags,
|
||||
GError **error);
|
||||
|
||||
typedef gboolean (*CoglTexture2DEGLImageExternalAlloc) (CoglTexture2D *tex_2d,
|
||||
|
@@ -182,6 +182,7 @@ typedef struct _CoglTextureLoader
|
||||
int width;
|
||||
int height;
|
||||
CoglPixelFormat format;
|
||||
CoglEglImageFlags flags;
|
||||
} egl_image;
|
||||
#endif
|
||||
#if defined (COGL_HAS_EGL_SUPPORT)
|
||||
|
@@ -18,10 +18,10 @@
|
||||
|
||||
#include "cogl-config.h"
|
||||
|
||||
#ifdef HAVE_TRACING
|
||||
|
||||
#include "cogl/cogl-trace.h"
|
||||
|
||||
#ifdef HAVE_TRACING
|
||||
|
||||
#include <sysprof-capture.h>
|
||||
#include <syscall.h>
|
||||
#include <sys/types.h>
|
||||
|
@@ -153,7 +153,6 @@ typedef struct _CoglTextureVertex CoglTextureVertex;
|
||||
* @COGL_FEATURE_TEXTURE_READ_PIXELS: glReadPixels() support
|
||||
* @COGL_FEATURE_OFFSCREEN: FBO support
|
||||
* @COGL_FEATURE_OFFSCREEN_MULTISAMPLE: Multisample support on FBOs
|
||||
* @COGL_FEATURE_OFFSCREEN_BLIT: Blit support on FBOs
|
||||
* @COGL_FEATURE_FOUR_CLIP_PLANES: At least 4 clip planes available
|
||||
* @COGL_FEATURE_STENCIL_BUFFER: Stencil buffer support
|
||||
* @COGL_FEATURE_VBOS: VBO support
|
||||
@@ -181,7 +180,6 @@ typedef enum
|
||||
COGL_FEATURE_TEXTURE_READ_PIXELS = (1 << 4),
|
||||
COGL_FEATURE_OFFSCREEN = (1 << 6),
|
||||
COGL_FEATURE_OFFSCREEN_MULTISAMPLE = (1 << 7),
|
||||
COGL_FEATURE_OFFSCREEN_BLIT = (1 << 8),
|
||||
COGL_FEATURE_FOUR_CLIP_PLANES = (1 << 9),
|
||||
COGL_FEATURE_STENCIL_BUFFER = (1 << 10),
|
||||
COGL_FEATURE_VBOS = (1 << 11),
|
||||
|
@@ -385,12 +385,9 @@ _cogl_framebuffer_gl_flush_state (CoglFramebuffer *draw_buffer,
|
||||
else
|
||||
{
|
||||
/* NB: Currently we only take advantage of binding separate
|
||||
* read/write buffers for offscreen framebuffer blit
|
||||
* purposes. */
|
||||
* read/write buffers for framebuffer blit purposes. */
|
||||
g_return_if_fail (_cogl_has_private_feature
|
||||
(ctx, COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT));
|
||||
g_return_if_fail (draw_buffer->type == COGL_FRAMEBUFFER_TYPE_OFFSCREEN);
|
||||
g_return_if_fail (read_buffer->type == COGL_FRAMEBUFFER_TYPE_OFFSCREEN);
|
||||
(ctx, COGL_PRIVATE_FEATURE_BLIT_FRAMEBUFFER));
|
||||
|
||||
_cogl_framebuffer_gl_bind (draw_buffer, GL_DRAW_FRAMEBUFFER);
|
||||
_cogl_framebuffer_gl_bind (read_buffer, GL_READ_FRAMEBUFFER);
|
||||
|
@@ -320,6 +320,8 @@ allocate_from_egl_image (CoglTexture2D *tex_2d,
|
||||
}
|
||||
|
||||
tex_2d->internal_format = internal_format;
|
||||
tex_2d->is_get_data_supported =
|
||||
!(loader->src.egl_image.flags & COGL_EGL_IMAGE_FLAG_NO_GET_DATA);
|
||||
|
||||
_cogl_texture_set_allocated (tex,
|
||||
internal_format,
|
||||
@@ -508,6 +510,7 @@ allocate_custom_egl_image_external (CoglTexture2D *tex_2d,
|
||||
|
||||
tex_2d->internal_format = internal_format;
|
||||
tex_2d->gl_target = GL_TEXTURE_EXTERNAL_OES;
|
||||
tex_2d->is_get_data_supported = FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -834,10 +837,7 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d,
|
||||
gboolean
|
||||
_cogl_texture_2d_gl_is_get_data_supported (CoglTexture2D *tex_2d)
|
||||
{
|
||||
if (tex_2d->gl_target == GL_TEXTURE_EXTERNAL_OES)
|
||||
return FALSE;
|
||||
else
|
||||
return TRUE;
|
||||
return tex_2d->is_get_data_supported;
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -421,7 +421,7 @@ _cogl_driver_update_features (CoglContext *ctx,
|
||||
|
||||
if (ctx->glBlitFramebuffer)
|
||||
COGL_FLAGS_SET (private_features,
|
||||
COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT, TRUE);
|
||||
COGL_PRIVATE_FEATURE_BLIT_FRAMEBUFFER, TRUE);
|
||||
|
||||
if (ctx->glRenderbufferStorageMultisampleIMG)
|
||||
{
|
||||
|
@@ -330,7 +330,7 @@ _cogl_driver_update_features (CoglContext *context,
|
||||
|
||||
if (context->glBlitFramebuffer)
|
||||
COGL_FLAGS_SET (private_features,
|
||||
COGL_PRIVATE_FEATURE_OFFSCREEN_BLIT, TRUE);
|
||||
COGL_PRIVATE_FEATURE_BLIT_FRAMEBUFFER, TRUE);
|
||||
|
||||
if (_cogl_check_extension ("GL_OES_element_index_uint", gl_extensions))
|
||||
{
|
||||
|
@@ -4,6 +4,7 @@
|
||||
* A Low Level GPU Graphics and Utilities API
|
||||
*
|
||||
* Copyright (C) 2009, 2011 Intel Corporation.
|
||||
* Copyright (C) 2019 DisplayLink (UK) Ltd.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
@@ -111,8 +112,8 @@ COGL_EXT_END ()
|
||||
|
||||
|
||||
COGL_EXT_BEGIN (offscreen_blit, 3, 0,
|
||||
0, /* not in either GLES */
|
||||
"EXT\0ANGLE\0",
|
||||
COGL_EXT_IN_GLES3,
|
||||
"EXT\0NV\0",
|
||||
"framebuffer_blit\0")
|
||||
COGL_EXT_FUNCTION (void, glBlitFramebuffer,
|
||||
(GLint srcX0,
|
||||
|
@@ -801,6 +801,7 @@ _cogl_winsys_texture_pixmap_x11_create (CoglTexturePixmapX11 *tex_pixmap)
|
||||
tex->height,
|
||||
texture_format,
|
||||
egl_tex_pixmap->image,
|
||||
COGL_EGL_IMAGE_FLAG_NONE,
|
||||
NULL));
|
||||
|
||||
tex_pixmap->winsys = egl_tex_pixmap;
|
||||
|
@@ -6,7 +6,9 @@ cdata.set('HAVE_GLES2', have_gles2.to_int())
|
||||
|
||||
cogl_installed_tests_libexecdir = join_paths(
|
||||
mutter_installed_tests_libexecdir, 'cogl', 'conform')
|
||||
install_data('run-tests.sh', install_dir: cogl_installed_tests_libexecdir)
|
||||
if have_installed_tests
|
||||
install_data('run-tests.sh', install_dir: cogl_installed_tests_libexecdir)
|
||||
endif
|
||||
|
||||
cogl_config_env = configure_file(
|
||||
input: 'config.env.in',
|
||||
|
@@ -1,5 +1,5 @@
|
||||
project('mutter', 'c',
|
||||
version: '3.33.2',
|
||||
version: '3.33.4',
|
||||
meson_version: '>= 0.50.0',
|
||||
license: 'GPLv2+'
|
||||
)
|
||||
@@ -18,7 +18,7 @@ uprof_req = '>= 0.3'
|
||||
pango_req = '>= 1.2.0'
|
||||
cairo_req = '>= 1.10.0'
|
||||
pangocairo_req = '>= 1.20'
|
||||
gsettings_desktop_schemas_req = '>= 3.31.0'
|
||||
gsettings_desktop_schemas_req = '>= 3.33.0'
|
||||
json_glib_req = '>= 0.12.0'
|
||||
upower_glib_req = '>= 0.99.0'
|
||||
xcomposite_req = '>= 0.4'
|
||||
|
@@ -8,6 +8,7 @@ data/mutter.desktop.in
|
||||
data/org.gnome.mutter.gschema.xml.in
|
||||
data/org.gnome.mutter.wayland.gschema.xml.in
|
||||
src/backends/meta-input-settings.c
|
||||
src/backends/meta-monitor.c
|
||||
src/backends/meta-monitor-manager.c
|
||||
src/backends/meta-profiler.c
|
||||
src/compositor/compositor.c
|
||||
|
102
po/fur.po
102
po/fur.po
@@ -7,15 +7,15 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: mutter master\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
|
||||
"POT-Creation-Date: 2019-05-03 17:25+0000\n"
|
||||
"PO-Revision-Date: 2019-05-03 19:39+0200\n"
|
||||
"POT-Creation-Date: 2019-06-28 19:41+0000\n"
|
||||
"PO-Revision-Date: 2019-07-01 21:01+0200\n"
|
||||
"Last-Translator: Fabio Tomat <f.t.public@gmail.com>\n"
|
||||
"Language-Team: Friulian <fur@li.org>\n"
|
||||
"Language: fur\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.2.1\n"
|
||||
"X-Generator: Poedit 2.2.3\n"
|
||||
|
||||
#: data/50-mutter-navigation.xml:6
|
||||
msgid "Navigation"
|
||||
@@ -391,7 +391,9 @@ msgid ""
|
||||
"proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes "
|
||||
"mutter default to layout logical monitors in a logical pixel coordinate "
|
||||
"space, while scaling monitor framebuffers instead of window content, to "
|
||||
"manage HiDPI monitors. Does not require a restart."
|
||||
"manage HiDPI monitors. Does not require a restart. • “rt-scheduler” — makes "
|
||||
"mutter request a low priority real-time scheduling. The executable or user "
|
||||
"must have CAP_SYS_NICE. Requires a restart."
|
||||
msgstr ""
|
||||
"Par abilitâ lis funzionalitâts sperimentâls, zonte la peraule clâf de "
|
||||
"funzionalitât ae liste. Il fat che la funzionalitât e vedi bisugne di tornâ "
|
||||
@@ -402,21 +404,32 @@ msgstr ""
|
||||
"“scale-monitor-framebuffer” — al rint come predefinît par mutter, la "
|
||||
"disposizion logjiche dai visôrs intun spazi logjic di coordenadis di pixel, "
|
||||
"in plui si fâs il scjalâ dai framebuffer dai visôrs invezit che il contignût "
|
||||
"dal barcon; dut chest par gjestî i visôrs HiDPI. Nol covente tornâ a inviâ."
|
||||
"dal barcon; dut chest par gjestî i visôrs HiDPI. Nol covente tornâ a inviâ. "
|
||||
"• “rt-scheduler” — al fâs in mût che mutter al domandi une programazion in "
|
||||
"timp reâl a prioritât basse. L'eseguibil o l'utent a scugnin vê "
|
||||
"CAP_SYS_NICE. Al covente tornâ a inviâ."
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:141
|
||||
#: data/org.gnome.mutter.gschema.xml.in:132
|
||||
msgid "Modifier to use to locate the pointer"
|
||||
msgstr "Modificadôr di doprâ par localizâ il pontadôr"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:133
|
||||
msgid "This key will initiate the “locate pointer” action."
|
||||
msgstr "Cheste clâf e inizializerâ la azion “localize pontadôr”."
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:153
|
||||
msgid "Select window from tab popup"
|
||||
msgstr "Selezione barcon dal tab popup"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:146
|
||||
#: data/org.gnome.mutter.gschema.xml.in:158
|
||||
msgid "Cancel tab popup"
|
||||
msgstr "Anule tab popup"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:151
|
||||
#: data/org.gnome.mutter.gschema.xml.in:163
|
||||
msgid "Switch monitor configurations"
|
||||
msgstr "Cambie configurazions visôr"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:156
|
||||
#: data/org.gnome.mutter.gschema.xml.in:168
|
||||
msgid "Rotates the built-in monitor configuration"
|
||||
msgstr "Al volte la configurazion dal visôr integrât"
|
||||
|
||||
@@ -473,29 +486,37 @@ msgid "Re-enable shortcuts"
|
||||
msgstr "Torne abilite lis scurtis"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:64
|
||||
msgid "Allow grabs with Xwayland"
|
||||
msgstr "Permet cjapadis di control cun Xwayland"
|
||||
msgid "Allow X11 grabs to lock keyboard focus with Xwayland"
|
||||
msgstr ""
|
||||
"Permet aes cjapadis di control cun X11 di blocâ la focalizazion de tastiere "
|
||||
"cun Xwayland"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:65
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"Allow keyboard grabs issued by X11 applications running in Xwayland to be "
|
||||
"taken into account. For a X11 grab to be taken into account under Wayland, "
|
||||
"the client must also either send a specific X11 ClientMessage to the root "
|
||||
"window or be among the applications white-listed in key “xwayland-grab-"
|
||||
"access-rules”."
|
||||
"Allow all keyboard events to be routed to X11 “override redirect” windows "
|
||||
"with a grab when running in Xwayland. This option is to support X11 clients "
|
||||
"which map an “override redirect” window (which do not receive keyboard "
|
||||
"focus) and issue a keyboard grab to force all keyboard events to that "
|
||||
"window. This option is seldom used and has no effect on regular X11 windows "
|
||||
"which can receive keyboard focus under normal circumstances. For a X11 grab "
|
||||
"to be taken into account under Wayland, the client must also either send a "
|
||||
"specific X11 ClientMessage to the root window or be among the applications "
|
||||
"white-listed in key “xwayland-grab-access-rules”."
|
||||
msgstr ""
|
||||
"Permet che il cjapâ il control de tastiere emetût di aplicazions X11 che a "
|
||||
"zirin in Xwayland, di jessi tignûts in considerazion. Par une cjapade di "
|
||||
"control di X11, par che e sedi tignude in considerazion sot Wayland, il "
|
||||
"client al scugne ancje inviâ un specific messaç (X11 ClientMessage) al "
|
||||
"barcon lidrîs o jessi tra lis aplicazions metudis te liste blancje inte clâf "
|
||||
"“xwayland-grab-access-rules”."
|
||||
"Permet a ducj i events di tastiere di jessi indreçâts sui barcons “override "
|
||||
"redirect” di X11 cuntun cjapâ il control de tastiere emetût di aplicazions "
|
||||
"X11 che a zirin in Xwayland, di jessi tignûts in considerazion. Par une "
|
||||
"cjapade di control di X11, par che e sedi tignude in considerazion sot "
|
||||
"Wayland, il client al scugne ancje inviâ un specific messaç (X11 "
|
||||
"ClientMessage) al barcon lidrîs o jessi tra lis aplicazions metudis te liste "
|
||||
"blancje inte clâf “xwayland-grab-access-rules”."
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:77
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:84
|
||||
msgid "Xwayland applications allowed to issue keyboard grabs"
|
||||
msgstr "Aplicazions Xwayland che a puedin cjapâ la tastiere"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:78
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:85
|
||||
msgid ""
|
||||
"List the resource names or resource class of X11 windows either allowed or "
|
||||
"not allowed to issue X11 keyboard grabs under Xwayland. The resource name or "
|
||||
@@ -522,7 +543,7 @@ msgstr ""
|
||||
#. TRANSLATORS: This string refers to a button that switches between
|
||||
#. * different modes.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:2426
|
||||
#: src/backends/meta-input-settings.c:2531
|
||||
#, c-format
|
||||
msgid "Mode Switch (Group %d)"
|
||||
msgstr "Cambie mût (Grup %d)"
|
||||
@@ -530,34 +551,34 @@ msgstr "Cambie mût (Grup %d)"
|
||||
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
|
||||
#. * mapping through the available outputs.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:2449
|
||||
#: src/backends/meta-input-settings.c:2554
|
||||
msgid "Switch monitor"
|
||||
msgstr "Cambie visôr"
|
||||
|
||||
#: src/backends/meta-input-settings.c:2451
|
||||
#: src/backends/meta-input-settings.c:2556
|
||||
msgid "Show on-screen help"
|
||||
msgstr "Mostre jutori a schermi"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:976
|
||||
#: src/backends/meta-monitor.c:223
|
||||
msgid "Built-in display"
|
||||
msgstr "Display integrât"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:1008
|
||||
#: src/backends/meta-monitor.c:252
|
||||
msgid "Unknown"
|
||||
msgstr "No cognossût"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:1010
|
||||
#: src/backends/meta-monitor.c:254
|
||||
msgid "Unknown Display"
|
||||
msgstr "Display no cognossût"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:1018
|
||||
#: src/backends/meta-monitor.c:262
|
||||
#, c-format
|
||||
msgctxt ""
|
||||
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
|
||||
msgid "%s %s"
|
||||
msgstr "%s %s"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:1026
|
||||
#: src/backends/meta-monitor.c:270
|
||||
#, c-format
|
||||
msgctxt ""
|
||||
"This is a monitor vendor name followed by product/model name where size in "
|
||||
@@ -565,9 +586,14 @@ msgctxt ""
|
||||
msgid "%s %s"
|
||||
msgstr "%s %s"
|
||||
|
||||
#. Translators: this string will appear in Sysprof
|
||||
#: src/backends/meta-profiler.c:82
|
||||
msgid "Compositor"
|
||||
msgstr "Composidôr"
|
||||
|
||||
#. This probably means that a non-WM compositor like xcompmgr is running;
|
||||
#. * we have no way to get it to exit
|
||||
#: src/compositor/compositor.c:508
|
||||
#: src/compositor/compositor.c:510
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Another compositing manager is already running on screen %i on display “%s”."
|
||||
@@ -672,7 +698,7 @@ msgstr "Stampe version"
|
||||
msgid "Mutter plugin to use"
|
||||
msgstr "Plugin Mutter di doprâ"
|
||||
|
||||
#: src/core/prefs.c:1786
|
||||
#: src/core/prefs.c:1834
|
||||
#, c-format
|
||||
msgid "Workspace %d"
|
||||
msgstr "Spazi di lavôr %d"
|
||||
@@ -686,7 +712,7 @@ msgstr "Mutter al è stât compilât cence supuart pe modalitât fetose\n"
|
||||
msgid "Mode Switch: Mode %d"
|
||||
msgstr "Cambie mût: mût %d"
|
||||
|
||||
#: src/x11/meta-x11-display.c:669
|
||||
#: src/x11/meta-x11-display.c:681
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Display “%s” already has a window manager; try using the --replace option to "
|
||||
@@ -695,16 +721,16 @@ msgstr ""
|
||||
"Il display “%s” al à za un window manager; prove dopre la opzion --replace "
|
||||
"par rimplaçâ chel atuâl."
|
||||
|
||||
#: src/x11/meta-x11-display.c:1011
|
||||
#: src/x11/meta-x11-display.c:1023
|
||||
msgid "Failed to initialize GDK\n"
|
||||
msgstr "No si è rivâts a inizializâ GDK\n"
|
||||
|
||||
#: src/x11/meta-x11-display.c:1035
|
||||
#: src/x11/meta-x11-display.c:1047
|
||||
#, c-format
|
||||
msgid "Failed to open X Window System display “%s”\n"
|
||||
msgstr "Impussibil vierzi il display “%s” di X Window System\n"
|
||||
|
||||
#: src/x11/meta-x11-display.c:1116
|
||||
#: src/x11/meta-x11-display.c:1131
|
||||
#, c-format
|
||||
msgid "Screen %d on display “%s” is invalid\n"
|
||||
msgstr "Schermi %d su display “%s” no valit\n"
|
||||
|
100
po/id.po
100
po/id.po
@@ -11,15 +11,15 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: mutter master\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
|
||||
"POT-Creation-Date: 2019-05-06 16:50+0000\n"
|
||||
"PO-Revision-Date: 2019-05-07 14:13+0700\n"
|
||||
"POT-Creation-Date: 2019-07-04 12:35+0000\n"
|
||||
"PO-Revision-Date: 2019-07-08 15:11+0700\n"
|
||||
"Last-Translator: Kukuh Syafaat <kukuhsyafaat@gnome.org>\n"
|
||||
"Language-Team: Indonesian <gnome-l10n-id@googlegroups.com>\n"
|
||||
"Language: id\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.2.1\n"
|
||||
"X-Generator: Poedit 2.2.3\n"
|
||||
"Plural-Forms: nplurals=2; plural= n!=1;\n"
|
||||
|
||||
#: data/50-mutter-navigation.xml:6
|
||||
@@ -395,7 +395,9 @@ msgid ""
|
||||
"proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes "
|
||||
"mutter default to layout logical monitors in a logical pixel coordinate "
|
||||
"space, while scaling monitor framebuffers instead of window content, to "
|
||||
"manage HiDPI monitors. Does not require a restart."
|
||||
"manage HiDPI monitors. Does not require a restart. • “rt-scheduler” — makes "
|
||||
"mutter request a low priority real-time scheduling. The executable or user "
|
||||
"must have CAP_SYS_NICE. Requires a restart."
|
||||
msgstr ""
|
||||
"Untuk mengaktifkan fitur eksperimental, tambahkan kata kunci fitur ke dalam "
|
||||
"daftar. Apakah fitur memerlukan nyala ulang kompositor tergantung pada fitur "
|
||||
@@ -405,21 +407,31 @@ msgstr ""
|
||||
"mungkin: • “scale-monitor-framebuffer” — membuat bawaan mutter untuk tata "
|
||||
"letak monitor logikal dalam ruang koordinat pixel logikal, sambil "
|
||||
"menskalakan framebuffer monitor alih-alih konten jendela, untuk mengelola "
|
||||
"monitor HiDPI. Tidak perlu mulai ulang."
|
||||
"monitor HiDPI. Tidak perlu nyala ulang. • \"rt-scheduler\" — membuat mutter "
|
||||
"meminta jadwal waktu sebenarnya prioritas rendah. Yang dapat dieksekusi atau "
|
||||
"pengguna harus memiliki CAP_SYS_NICE. Membutuhkan nyala ulang."
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:141
|
||||
#: data/org.gnome.mutter.gschema.xml.in:132
|
||||
msgid "Modifier to use to locate the pointer"
|
||||
msgstr "Pengubah yang digunakan untuk menemukan penunjuk"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:133
|
||||
msgid "This key will initiate the “locate pointer” action."
|
||||
msgstr "Kunci ini akan memulai aksi \"penunjuk lokasi\"."
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:153
|
||||
msgid "Select window from tab popup"
|
||||
msgstr "Pilih jendela dari popup tab"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:146
|
||||
#: data/org.gnome.mutter.gschema.xml.in:158
|
||||
msgid "Cancel tab popup"
|
||||
msgstr "Batalkan popup tab"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:151
|
||||
#: data/org.gnome.mutter.gschema.xml.in:163
|
||||
msgid "Switch monitor configurations"
|
||||
msgstr "Tukar konfigurasi monitor bawaan"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:156
|
||||
#: data/org.gnome.mutter.gschema.xml.in:168
|
||||
msgid "Rotates the built-in monitor configuration"
|
||||
msgstr "Memutar konfigurasi monitor bawaan"
|
||||
|
||||
@@ -476,30 +488,39 @@ msgid "Re-enable shortcuts"
|
||||
msgstr "Aktifkan kembali pintasan"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:64
|
||||
msgid "Allow grabs with Xwayland"
|
||||
msgstr "Izinkan menggenggam dengan Xwayland"
|
||||
msgid "Allow X11 grabs to lock keyboard focus with Xwayland"
|
||||
msgstr "Izinkan X11 menggenggam untuk mengunci fokus papan tik dengan Xwayland"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:65
|
||||
msgid ""
|
||||
"Allow keyboard grabs issued by X11 applications running in Xwayland to be "
|
||||
"taken into account. For a X11 grab to be taken into account under Wayland, "
|
||||
"the client must also either send a specific X11 ClientMessage to the root "
|
||||
"window or be among the applications white-listed in key “xwayland-grab-"
|
||||
"access-rules”."
|
||||
"Allow all keyboard events to be routed to X11 “override redirect” windows "
|
||||
"with a grab when running in Xwayland. This option is to support X11 clients "
|
||||
"which map an “override redirect” window (which do not receive keyboard "
|
||||
"focus) and issue a keyboard grab to force all keyboard events to that "
|
||||
"window. This option is seldom used and has no effect on regular X11 windows "
|
||||
"which can receive keyboard focus under normal circumstances. For a X11 grab "
|
||||
"to be taken into account under Wayland, the client must also either send a "
|
||||
"specific X11 ClientMessage to the root window or be among the applications "
|
||||
"white-listed in key “xwayland-grab-access-rules”."
|
||||
msgstr ""
|
||||
"Mengizinkan pengambilalihan papan ketik yang dikeluarkan oleh aplikasi X11 "
|
||||
"yang berjalan di Xwayland untuk diperhitungkan. Agar pengambilalihan X11 "
|
||||
"diperhitungkan di bawah Wayland, klien juga harus mengirimkan ClientMessage "
|
||||
"X11 tertentu ke jendela root atau berada di antara aplikasi yang tercantum "
|
||||
"dalam daftar putih \"xwayland-grab-access-rules\"."
|
||||
"Izinkan semua peristiwa papan tik dialihkan ke jendela X11 \"override "
|
||||
"redirect\" dengan perambanan saat berjalan di Xwayland. Opsi ini adalah "
|
||||
"untuk mendukung klien X11 yang memetakan jendela \"override redirect\" (yang "
|
||||
"tidak menerima fokus papan tik) dan mengeluarkan pegangan papan tik untuk "
|
||||
"memaksa semua peristiwa papan tik ke jendela itu. Opsi ini jarang digunakan "
|
||||
"dan tidak berpengaruh pada jendela X11 biasa yang dapat menerima fokus papan "
|
||||
"tik dalam keadaan normal. Agar pengambilan X11 diperhitungkan di bawah "
|
||||
"Wayland, klien juga harus mengirim PesanKlien X11 tertentu ke jendela root "
|
||||
"atau di antara aplikasi yang masuk dalam daftar putih “xwayland-grab-access-"
|
||||
"rules”."
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:77
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:84
|
||||
msgid "Xwayland applications allowed to issue keyboard grabs"
|
||||
msgstr ""
|
||||
"Aplikasi Xwayland yang diizinkan untuk mengeluarkan pengambilalihan papan "
|
||||
"ketik"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:78
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:85
|
||||
msgid ""
|
||||
"List the resource names or resource class of X11 windows either allowed or "
|
||||
"not allowed to issue X11 keyboard grabs under Xwayland. The resource name or "
|
||||
@@ -527,7 +548,7 @@ msgstr ""
|
||||
#. TRANSLATORS: This string refers to a button that switches between
|
||||
#. * different modes.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:2426
|
||||
#: src/backends/meta-input-settings.c:2531
|
||||
#, c-format
|
||||
msgid "Mode Switch (Group %d)"
|
||||
msgstr "Tukar Mode: (Grup %d)"
|
||||
@@ -535,34 +556,34 @@ msgstr "Tukar Mode: (Grup %d)"
|
||||
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
|
||||
#. * mapping through the available outputs.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:2449
|
||||
#: src/backends/meta-input-settings.c:2554
|
||||
msgid "Switch monitor"
|
||||
msgstr "Berpindah monitor"
|
||||
|
||||
#: src/backends/meta-input-settings.c:2451
|
||||
#: src/backends/meta-input-settings.c:2556
|
||||
msgid "Show on-screen help"
|
||||
msgstr "Tampilkan bantuan pada layar"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:976
|
||||
#: src/backends/meta-monitor.c:223
|
||||
msgid "Built-in display"
|
||||
msgstr "Tampilan bawaan"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:1008
|
||||
#: src/backends/meta-monitor.c:252
|
||||
msgid "Unknown"
|
||||
msgstr "Tak Dikenal"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:1010
|
||||
#: src/backends/meta-monitor.c:254
|
||||
msgid "Unknown Display"
|
||||
msgstr "Tampilan Tak Dikenal"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:1018
|
||||
#: src/backends/meta-monitor.c:262
|
||||
#, c-format
|
||||
msgctxt ""
|
||||
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
|
||||
msgid "%s %s"
|
||||
msgstr "%s %s"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:1026
|
||||
#: src/backends/meta-monitor.c:270
|
||||
#, c-format
|
||||
msgctxt ""
|
||||
"This is a monitor vendor name followed by product/model name where size in "
|
||||
@@ -570,9 +591,14 @@ msgctxt ""
|
||||
msgid "%s %s"
|
||||
msgstr "%s %s"
|
||||
|
||||
#. Translators: this string will appear in Sysprof
|
||||
#: src/backends/meta-profiler.c:82
|
||||
msgid "Compositor"
|
||||
msgstr "Kompositor"
|
||||
|
||||
#. This probably means that a non-WM compositor like xcompmgr is running;
|
||||
#. * we have no way to get it to exit
|
||||
#: src/compositor/compositor.c:508
|
||||
#: src/compositor/compositor.c:510
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Another compositing manager is already running on screen %i on display “%s”."
|
||||
@@ -676,7 +702,7 @@ msgstr "Cetak versi"
|
||||
msgid "Mutter plugin to use"
|
||||
msgstr "Pengaya Mutter yang dipakai"
|
||||
|
||||
#: src/core/prefs.c:1786
|
||||
#: src/core/prefs.c:1834
|
||||
#, c-format
|
||||
msgid "Workspace %d"
|
||||
msgstr "Area kerja %d"
|
||||
@@ -690,7 +716,7 @@ msgstr "Muter dikompilasi tanpa dukungan mode riuh\n"
|
||||
msgid "Mode Switch: Mode %d"
|
||||
msgstr "Tukar Mode: Mode %d"
|
||||
|
||||
#: src/x11/meta-x11-display.c:669
|
||||
#: src/x11/meta-x11-display.c:682
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Display “%s” already has a window manager; try using the --replace option to "
|
||||
@@ -699,16 +725,16 @@ msgstr ""
|
||||
"Tampilan \"%s\" sudah memiliki manajer jendela; cobalah gunakan pilihan --"
|
||||
"replace untuk mengganti manajer jendela saat ini."
|
||||
|
||||
#: src/x11/meta-x11-display.c:1011
|
||||
#: src/x11/meta-x11-display.c:1024
|
||||
msgid "Failed to initialize GDK\n"
|
||||
msgstr "Gagal menginisialisasi GDK\n"
|
||||
|
||||
#: src/x11/meta-x11-display.c:1035
|
||||
#: src/x11/meta-x11-display.c:1048
|
||||
#, c-format
|
||||
msgid "Failed to open X Window System display “%s”\n"
|
||||
msgstr "Gagal membuka tampilan X Window System \"%s\"\n"
|
||||
|
||||
#: src/x11/meta-x11-display.c:1116
|
||||
#: src/x11/meta-x11-display.c:1132
|
||||
#, c-format
|
||||
msgid "Screen %d on display “%s” is invalid\n"
|
||||
msgstr "Layar %d pada tampilan \"%s\" tidak valid\n"
|
||||
|
146
po/pt_BR.po
146
po/pt_BR.po
@@ -21,16 +21,16 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: mutter\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
|
||||
"POT-Creation-Date: 2019-02-04 17:52+0000\n"
|
||||
"PO-Revision-Date: 2019-02-20 22:11-0300\n"
|
||||
"POT-Creation-Date: 2019-07-18 13:55+0000\n"
|
||||
"PO-Revision-Date: 2019-07-22 01:40-0300\n"
|
||||
"Last-Translator: Rafael Fontenelle <rafaelff@gnome.org>\n"
|
||||
"Language-Team: Portuguese - Brazil <gnome-pt_br-list@gnome.org>\n"
|
||||
"Language-Team: Brazilian Portuguese <gnome-pt_br-list@gnome.org>\n"
|
||||
"Language: pt_BR\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
||||
"X-Generator: Gtranslator 3.31.90\n"
|
||||
"X-Generator: Gtranslator 3.32.0\n"
|
||||
"X-Project-Style: gnome\n"
|
||||
|
||||
#: data/50-mutter-navigation.xml:6
|
||||
@@ -406,6 +406,16 @@ msgid "Enable experimental features"
|
||||
msgstr "Habilitar recursos experimentais"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:108
|
||||
#| msgid ""
|
||||
#| "To enable experimental features, add the feature keyword to the list. "
|
||||
#| "Whether the feature requires restarting the compositor depends on the "
|
||||
#| "given feature. Any experimental feature is not required to still be "
|
||||
#| "available, or configurable. Don’t expect adding anything in this setting "
|
||||
#| "to be future proof. Currently possible keywords: • “scale-monitor-"
|
||||
#| "framebuffer” — makes mutter default to layout logical monitors in a "
|
||||
#| "logical pixel coordinate space, while scaling monitor framebuffers "
|
||||
#| "instead of window content, to manage HiDPI monitors. Does not require a "
|
||||
#| "restart."
|
||||
msgid ""
|
||||
"To enable experimental features, add the feature keyword to the list. "
|
||||
"Whether the feature requires restarting the compositor depends on the given "
|
||||
@@ -414,7 +424,9 @@ msgid ""
|
||||
"proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes "
|
||||
"mutter default to layout logical monitors in a logical pixel coordinate "
|
||||
"space, while scaling monitor framebuffers instead of window content, to "
|
||||
"manage HiDPI monitors. Does not require a restart."
|
||||
"manage HiDPI monitors. Does not require a restart. • “rt-scheduler” — makes "
|
||||
"mutter request a low priority real-time scheduling. The executable or user "
|
||||
"must have CAP_SYS_NICE. Requires a restart."
|
||||
msgstr ""
|
||||
"Para habilitar recursos experimentais, adicione a palavra-chave do recurso à "
|
||||
"lista. Se o recurso exige ou não reiniciar o compositor, depende do recurso "
|
||||
@@ -424,21 +436,31 @@ msgstr ""
|
||||
"framebuffer” — torna o mutter padrão para a disposição de monitores lógicos "
|
||||
"em um espaço lógico coordenado por pixels, ao dimensionar buffers de quadros "
|
||||
"de monitor em vez de conteúdo de janela, para gerenciar monitores HiDPI. Não "
|
||||
"exige uma reinicialização."
|
||||
"exige uma reinicialização. • “rt-scheduler” — faz o mutter solicitar um "
|
||||
"agendamento de tempo real de baixa prioridade. O executável ou usuário deve "
|
||||
"ter CAP_SYS_NICE. Exige uma reinicialização."
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:141
|
||||
#: data/org.gnome.mutter.gschema.xml.in:132
|
||||
msgid "Modifier to use to locate the pointer"
|
||||
msgstr "Modificador para usar ao localizar o ponteiro"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:133
|
||||
msgid "This key will initiate the “locate pointer” action."
|
||||
msgstr "Essa chave vai iniciar a ação de “localizar ponteiro”."
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:153
|
||||
msgid "Select window from tab popup"
|
||||
msgstr "Selecione a janela a partir da aba instantânea"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:146
|
||||
#: data/org.gnome.mutter.gschema.xml.in:158
|
||||
msgid "Cancel tab popup"
|
||||
msgstr "Cancelar aba instantânea"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:151
|
||||
#: data/org.gnome.mutter.gschema.xml.in:163
|
||||
msgid "Switch monitor configurations"
|
||||
msgstr "Trocar configurações de monitor"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:156
|
||||
#: data/org.gnome.mutter.gschema.xml.in:168
|
||||
msgid "Rotates the built-in monitor configuration"
|
||||
msgstr "Gira a configuração de monitor embutido"
|
||||
|
||||
@@ -495,28 +517,44 @@ msgid "Re-enable shortcuts"
|
||||
msgstr "Reabilita atalhos"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:64
|
||||
msgid "Allow grabs with Xwayland"
|
||||
msgstr "Permitir capturas com Xwayland"
|
||||
#| msgid "Allow grabs with Xwayland"
|
||||
msgid "Allow X11 grabs to lock keyboard focus with Xwayland"
|
||||
msgstr "Permitir as capturas do X11 travar o foco do teclado com Xwayland"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:65
|
||||
#| msgid ""
|
||||
#| "Allow keyboard grabs issued by X11 applications running in Xwayland to be "
|
||||
#| "taken into account. For a X11 grab to be taken into account under "
|
||||
#| "Wayland, the client must also either send a specific X11 ClientMessage to "
|
||||
#| "the root window or be among the applications white-listed in key "
|
||||
#| "“xwayland-grab-access-rules”."
|
||||
msgid ""
|
||||
"Allow keyboard grabs issued by X11 applications running in Xwayland to be "
|
||||
"taken into account. For a X11 grab to be taken into account under Wayland, "
|
||||
"the client must also either send a specific X11 ClientMessage to the root "
|
||||
"window or be among the applications white-listed in key “xwayland-grab-"
|
||||
"access-rules”."
|
||||
"Allow all keyboard events to be routed to X11 “override redirect” windows "
|
||||
"with a grab when running in Xwayland. This option is to support X11 clients "
|
||||
"which map an “override redirect” window (which do not receive keyboard "
|
||||
"focus) and issue a keyboard grab to force all keyboard events to that "
|
||||
"window. This option is seldom used and has no effect on regular X11 windows "
|
||||
"which can receive keyboard focus under normal circumstances. For a X11 grab "
|
||||
"to be taken into account under Wayland, the client must also either send a "
|
||||
"specific X11 ClientMessage to the root window or be among the applications "
|
||||
"white-listed in key “xwayland-grab-access-rules”."
|
||||
msgstr ""
|
||||
"Permite capturas de teclado emitidas por aplicativos X11 em execução no "
|
||||
"Xwayland para serem levadas em consideração. Para que uma captura de X11 "
|
||||
"seja levada em consideração no Wayland, o cliente também deve enviar um X11 "
|
||||
"ClientMessage específica para a janela raiz ou estar entre os aplicativos "
|
||||
"listados em branco na chave “xwayland-grab-access-rules”."
|
||||
"Permita que todos os eventos do teclado sejam roteados para as janelas "
|
||||
"“override redirect” do X11 com uma captura ao executar no Xwayland. Esta "
|
||||
"opção é para ter suporte a clientes X11 que mapeiam uma janela “override "
|
||||
"redirect” (que não recebe o foco do teclado) e emitem uma captura de teclado "
|
||||
"para forçar todos os eventos do teclado para aquela janela. Esta opção é "
|
||||
"raramente usada e não tem efeito nas janelas comuns do X11, que podem "
|
||||
"receber o foco do teclado em circunstâncias normais. Para que uma captura de "
|
||||
"X11 seja levada em conta no Wayland, o cliente também deve enviar uma "
|
||||
"ClientMessage específica do X11 para a janela raiz ou estar entre os "
|
||||
"aplicativos na lista branca na chave “xwayland-grab-access-rules”."
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:77
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:84
|
||||
msgid "Xwayland applications allowed to issue keyboard grabs"
|
||||
msgstr "Aplicativos Xwayland com permissão para emitir capturas de teclado"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:78
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:85
|
||||
msgid ""
|
||||
"List the resource names or resource class of X11 windows either allowed or "
|
||||
"not allowed to issue X11 keyboard grabs under Xwayland. The resource name or "
|
||||
@@ -543,7 +581,7 @@ msgstr ""
|
||||
#. TRANSLATORS: This string refers to a button that switches between
|
||||
#. * different modes.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:2423
|
||||
#: src/backends/meta-input-settings.c:2531
|
||||
#, c-format
|
||||
msgid "Mode Switch (Group %d)"
|
||||
msgstr "Alternador de modo (Grupo %d)"
|
||||
@@ -551,52 +589,56 @@ msgstr "Alternador de modo (Grupo %d)"
|
||||
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
|
||||
#. * mapping through the available outputs.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:2446
|
||||
#: src/backends/meta-input-settings.c:2554
|
||||
msgid "Switch monitor"
|
||||
msgstr "Trocar monitor"
|
||||
|
||||
#: src/backends/meta-input-settings.c:2448
|
||||
#: src/backends/meta-input-settings.c:2556
|
||||
msgid "Show on-screen help"
|
||||
msgstr "Mostrar ajuda na tela"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:954
|
||||
#: src/backends/meta-monitor.c:223
|
||||
msgid "Built-in display"
|
||||
msgstr "Tela embutida"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:986
|
||||
#: src/backends/meta-monitor.c:252
|
||||
msgid "Unknown"
|
||||
msgstr "Desconhecido"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:988
|
||||
#: src/backends/meta-monitor.c:254
|
||||
msgid "Unknown Display"
|
||||
msgstr "Monitor desconhecido"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:996
|
||||
#: src/backends/meta-monitor.c:262
|
||||
#, c-format
|
||||
#| msgid "%s %s"
|
||||
msgctxt ""
|
||||
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
|
||||
msgid "%s %s"
|
||||
msgstr "%s %s"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:1004
|
||||
#: src/backends/meta-monitor.c:270
|
||||
#, c-format
|
||||
#| msgid "%s %s"
|
||||
msgctxt ""
|
||||
"This is a monitor vendor name followed by product/model name where size in "
|
||||
"inches could not be calculated, e.g. Dell U2414H"
|
||||
msgid "%s %s"
|
||||
msgstr "%s %s"
|
||||
|
||||
#. Translators: this string will appear in Sysprof
|
||||
#: src/backends/meta-profiler.c:82
|
||||
#| msgid "Compositing Manager"
|
||||
msgid "Compositor"
|
||||
msgstr "Compositor"
|
||||
|
||||
#. This probably means that a non-WM compositor like xcompmgr is running;
|
||||
#. * we have no way to get it to exit
|
||||
#: src/compositor/compositor.c:482
|
||||
#: src/compositor/compositor.c:510
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Another compositing manager is already running on screen %i on display “%s”."
|
||||
msgstr "Outro compositor de janelas está em execução na tela %i na área “%s”."
|
||||
msgstr "Outro gerenciador de composição de janelas está em execução na tela %i na área “%s”."
|
||||
|
||||
#: src/core/bell.c:252
|
||||
#: src/core/bell.c:192
|
||||
msgid "Bell event"
|
||||
msgstr "Evento de som"
|
||||
|
||||
@@ -645,16 +687,16 @@ msgid "Run with X11 backend"
|
||||
msgstr "Executa com backend X11"
|
||||
|
||||
#. Translators: %s is a window title
|
||||
#: src/core/meta-close-dialog-default.c:150
|
||||
#: src/core/meta-close-dialog-default.c:151
|
||||
#, c-format
|
||||
msgid "“%s” is not responding."
|
||||
msgstr "“%s” não está respondendo."
|
||||
|
||||
#: src/core/meta-close-dialog-default.c:152
|
||||
#: src/core/meta-close-dialog-default.c:153
|
||||
msgid "Application is not responding."
|
||||
msgstr "O aplicativo não está respondendo."
|
||||
|
||||
#: src/core/meta-close-dialog-default.c:157
|
||||
#: src/core/meta-close-dialog-default.c:158
|
||||
msgid ""
|
||||
"You may choose to wait a short while for it to continue or force the "
|
||||
"application to quit entirely."
|
||||
@@ -662,11 +704,11 @@ msgstr ""
|
||||
"Você pode escolher aguardar um pouco e continuar ou forçar o aplicativo a "
|
||||
"sair completamente."
|
||||
|
||||
#: src/core/meta-close-dialog-default.c:164
|
||||
#: src/core/meta-close-dialog-default.c:165
|
||||
msgid "_Force Quit"
|
||||
msgstr "_Forçar sair"
|
||||
|
||||
#: src/core/meta-close-dialog-default.c:164
|
||||
#: src/core/meta-close-dialog-default.c:165
|
||||
msgid "_Wait"
|
||||
msgstr "_Esperar"
|
||||
|
||||
@@ -694,7 +736,7 @@ msgstr "Versão impressa"
|
||||
msgid "Mutter plugin to use"
|
||||
msgstr "Plug-in do Mutter para usar"
|
||||
|
||||
#: src/core/prefs.c:1786
|
||||
#: src/core/prefs.c:1849
|
||||
#, c-format
|
||||
msgid "Workspace %d"
|
||||
msgstr "Espaço de trabalho %d"
|
||||
@@ -708,7 +750,7 @@ msgstr "O Mutter foi compilado sem suporte para modo detalhado\n"
|
||||
msgid "Mode Switch: Mode %d"
|
||||
msgstr "Alternador de modo: Modo %d"
|
||||
|
||||
#: src/x11/meta-x11-display.c:666
|
||||
#: src/x11/meta-x11-display.c:682
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Display “%s” already has a window manager; try using the --replace option to "
|
||||
@@ -717,20 +759,25 @@ msgstr ""
|
||||
"A exibição “%s” já possui um gerenciador de janelas; tente usar a opção --"
|
||||
"replace para substituir o gerenciador de janelas atual."
|
||||
|
||||
#: src/x11/meta-x11-display.c:1008
|
||||
#: src/x11/meta-x11-display.c:1024
|
||||
msgid "Failed to initialize GDK\n"
|
||||
msgstr "Falha ao inicializar GDK\n"
|
||||
|
||||
#: src/x11/meta-x11-display.c:1032
|
||||
#: src/x11/meta-x11-display.c:1048
|
||||
#, c-format
|
||||
msgid "Failed to open X Window System display “%s”\n"
|
||||
msgstr "Falha ao abrir a exibição “%s” do sistema de janelas X\n"
|
||||
|
||||
#: src/x11/meta-x11-display.c:1115
|
||||
#: src/x11/meta-x11-display.c:1132
|
||||
#, c-format
|
||||
msgid "Screen %d on display “%s” is invalid\n"
|
||||
msgstr "A tela %d na exibição “%s” é inválida\n"
|
||||
|
||||
#: src/x11/meta-x11-selection-input-stream.c:445
|
||||
#, c-format
|
||||
msgid "Format %s not supported"
|
||||
msgstr "Sem suporte ao formato %s"
|
||||
|
||||
#: src/x11/session.c:1821
|
||||
msgid ""
|
||||
"These windows do not support “save current setup” and will have to be "
|
||||
@@ -739,7 +786,7 @@ msgstr ""
|
||||
"Estas janelas não oferecem suporte para a opção “salvar configuração atual” "
|
||||
"e precisarão ser reiniciadas manualmente quando você reiniciar a sessão."
|
||||
|
||||
#: src/x11/window-props.c:568
|
||||
#: src/x11/window-props.c:569
|
||||
#, c-format
|
||||
msgid "%s (on %s)"
|
||||
msgstr "%s (em %s)"
|
||||
@@ -2072,9 +2119,6 @@ msgstr "%s (em %s)"
|
||||
#~ msgid "Commands to run in response to keybindings"
|
||||
#~ msgstr "Comandos executados em resposta a teclas de atalho"
|
||||
|
||||
#~ msgid "Compositing Manager"
|
||||
#~ msgstr "Gerenciador de composição"
|
||||
|
||||
#~ msgid "Control how new windows get focus"
|
||||
#~ msgstr "Controla como novas janelas obtêm foco"
|
||||
|
||||
|
@@ -144,6 +144,7 @@ struct _MetaBackendPrivate
|
||||
gboolean is_pointer_position_initialized;
|
||||
|
||||
guint device_update_idle_id;
|
||||
guint keymap_state_changed_id;
|
||||
|
||||
GHashTable *device_monitors;
|
||||
|
||||
@@ -178,6 +179,14 @@ meta_backend_finalize (GObject *object)
|
||||
MetaBackend *backend = META_BACKEND (object);
|
||||
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
|
||||
|
||||
if (priv->keymap_state_changed_id)
|
||||
{
|
||||
ClutterKeymap *keymap;
|
||||
|
||||
keymap = clutter_backend_get_keymap (priv->clutter_backend);
|
||||
g_signal_handler_disconnect (keymap, priv->keymap_state_changed_id);
|
||||
}
|
||||
|
||||
g_list_free_full (priv->gpus, g_object_unref);
|
||||
|
||||
g_clear_object (&priv->monitor_manager);
|
||||
@@ -491,6 +500,7 @@ meta_backend_real_post_init (MetaBackend *backend)
|
||||
{
|
||||
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
|
||||
ClutterDeviceManager *device_manager = clutter_device_manager_get_default ();
|
||||
ClutterKeymap *keymap = clutter_backend_get_keymap (priv->clutter_backend);
|
||||
|
||||
priv->stage = meta_stage_new (backend);
|
||||
clutter_actor_realize (priv->stage);
|
||||
@@ -517,6 +527,15 @@ meta_backend_real_post_init (MetaBackend *backend)
|
||||
|
||||
priv->input_settings = meta_backend_create_input_settings (backend);
|
||||
|
||||
if (priv->input_settings)
|
||||
{
|
||||
priv->keymap_state_changed_id =
|
||||
g_signal_connect_swapped (keymap, "state-changed",
|
||||
G_CALLBACK (meta_input_settings_maybe_save_numlock_state),
|
||||
priv->input_settings);
|
||||
meta_input_settings_maybe_restore_numlock_state (priv->input_settings);
|
||||
}
|
||||
|
||||
#ifdef HAVE_REMOTE_DESKTOP
|
||||
priv->remote_access_controller =
|
||||
g_object_new (META_TYPE_REMOTE_ACCESS_CONTROLLER, NULL);
|
||||
|
@@ -302,7 +302,7 @@ meta_barrier_destroy (MetaBarrier *barrier)
|
||||
static void
|
||||
meta_barrier_init (MetaBarrier *barrier)
|
||||
{
|
||||
barrier->priv = G_TYPE_INSTANCE_GET_PRIVATE (barrier, META_TYPE_BARRIER, MetaBarrierPrivate);
|
||||
barrier->priv = meta_barrier_get_instance_private (barrier);
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -50,6 +50,7 @@ enum
|
||||
{
|
||||
CURSOR_CHANGED,
|
||||
CURSOR_MOVED,
|
||||
VISIBILITY_CHANGED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
@@ -173,6 +174,13 @@ meta_cursor_tracker_class_init (MetaCursorTrackerClass *klass)
|
||||
G_TYPE_NONE, 2,
|
||||
G_TYPE_FLOAT,
|
||||
G_TYPE_FLOAT);
|
||||
|
||||
signals[VISIBILITY_CHANGED] = g_signal_new ("visibility-changed",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -418,6 +426,12 @@ meta_cursor_tracker_get_pointer (MetaCursorTracker *tracker,
|
||||
get_pointer_position_gdk (x, y, (int*)mods);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_cursor_tracker_get_pointer_visible (MetaCursorTracker *tracker)
|
||||
{
|
||||
return tracker->is_showing;
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_tracker_set_pointer_visible (MetaCursorTracker *tracker,
|
||||
gboolean visible)
|
||||
@@ -427,6 +441,8 @@ meta_cursor_tracker_set_pointer_visible (MetaCursorTracker *tracker,
|
||||
tracker->is_showing = visible;
|
||||
|
||||
sync_cursor (tracker);
|
||||
|
||||
g_signal_emit (tracker, signals[VISIBILITY_CHANGED], 0);
|
||||
}
|
||||
|
||||
MetaCursorSprite *
|
||||
|
@@ -30,6 +30,8 @@ gboolean meta_dnd_handle_xdnd_event (MetaBackend *backend,
|
||||
Display *xdisplay,
|
||||
XEvent *xev);
|
||||
|
||||
void meta_dnd_init_xdnd (MetaX11Display *x11_display);
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
void meta_dnd_wayland_handle_begin_modal (MetaCompositor *compositor);
|
||||
void meta_dnd_wayland_handle_end_modal (MetaCompositor *compositor);
|
||||
|
@@ -1,7 +1,8 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/*
|
||||
* Copyright (C) 2016 Red Hat Inc.
|
||||
* Copyright (C) 2016, 2017 Red Hat Inc.
|
||||
* Copyright (C) 2018, 2019 DisplayLink (UK) Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
@@ -574,6 +575,97 @@ meta_egl_destroy_image (MetaEgl *egl,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
EGLImageKHR
|
||||
meta_egl_create_dmabuf_image (MetaEgl *egl,
|
||||
EGLDisplay egl_display,
|
||||
unsigned int width,
|
||||
unsigned int height,
|
||||
uint32_t drm_format,
|
||||
uint32_t n_planes,
|
||||
const int *fds,
|
||||
const uint32_t *strides,
|
||||
const uint32_t *offsets,
|
||||
const uint64_t *modifiers,
|
||||
GError **error)
|
||||
{
|
||||
EGLint attribs[37];
|
||||
int atti = 0;
|
||||
|
||||
/* This requires the Mesa commit in
|
||||
* Mesa 10.3 (08264e5dad4df448e7718e782ad9077902089a07) or
|
||||
* Mesa 10.2.7 (55d28925e6109a4afd61f109e845a8a51bd17652).
|
||||
* Otherwise Mesa closes the fd behind our back and re-importing
|
||||
* will fail.
|
||||
* https://bugs.freedesktop.org/show_bug.cgi?id=76188
|
||||
*/
|
||||
|
||||
attribs[atti++] = EGL_WIDTH;
|
||||
attribs[atti++] = width;
|
||||
attribs[atti++] = EGL_HEIGHT;
|
||||
attribs[atti++] = height;
|
||||
attribs[atti++] = EGL_LINUX_DRM_FOURCC_EXT;
|
||||
attribs[atti++] = drm_format;
|
||||
|
||||
if (n_planes > 0)
|
||||
{
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE0_FD_EXT;
|
||||
attribs[atti++] = fds[0];
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT;
|
||||
attribs[atti++] = offsets[0];
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE0_PITCH_EXT;
|
||||
attribs[atti++] = strides[0];
|
||||
if (modifiers)
|
||||
{
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT;
|
||||
attribs[atti++] = modifiers[0] & 0xFFFFFFFF;
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT;
|
||||
attribs[atti++] = modifiers[0] >> 32;
|
||||
}
|
||||
}
|
||||
|
||||
if (n_planes > 1)
|
||||
{
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE1_FD_EXT;
|
||||
attribs[atti++] = fds[1];
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE1_OFFSET_EXT;
|
||||
attribs[atti++] = offsets[1];
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE1_PITCH_EXT;
|
||||
attribs[atti++] = strides[1];
|
||||
if (modifiers)
|
||||
{
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT;
|
||||
attribs[atti++] = modifiers[1] & 0xFFFFFFFF;
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT;
|
||||
attribs[atti++] = modifiers[1] >> 32;
|
||||
}
|
||||
}
|
||||
|
||||
if (n_planes > 2)
|
||||
{
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE2_FD_EXT;
|
||||
attribs[atti++] = fds[2];
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE2_OFFSET_EXT;
|
||||
attribs[atti++] = offsets[2];
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE2_PITCH_EXT;
|
||||
attribs[atti++] = strides[2];
|
||||
if (modifiers)
|
||||
{
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT;
|
||||
attribs[atti++] = modifiers[2] & 0xFFFFFFFF;
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT;
|
||||
attribs[atti++] = modifiers[2] >> 32;
|
||||
}
|
||||
}
|
||||
|
||||
attribs[atti++] = EGL_NONE;
|
||||
g_assert (atti <= G_N_ELEMENTS (attribs));
|
||||
|
||||
return meta_egl_create_image (egl, egl_display, EGL_NO_CONTEXT,
|
||||
EGL_LINUX_DMA_BUF_EXT, NULL,
|
||||
attribs,
|
||||
error);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_egl_make_current (MetaEgl *egl,
|
||||
EGLDisplay display,
|
||||
|
@@ -2,6 +2,7 @@
|
||||
|
||||
/*
|
||||
* Copyright (C) 2016 Red Hat Inc.
|
||||
* Copyright (C) 2019 DisplayLink (UK) Ltd.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
@@ -100,6 +101,18 @@ gboolean meta_egl_destroy_image (MetaEgl *egl,
|
||||
EGLImageKHR image,
|
||||
GError **error);
|
||||
|
||||
EGLImageKHR meta_egl_create_dmabuf_image (MetaEgl *egl,
|
||||
EGLDisplay egl_display,
|
||||
unsigned int width,
|
||||
unsigned int height,
|
||||
uint32_t drm_format,
|
||||
uint32_t n_planes,
|
||||
const int *fds,
|
||||
const uint32_t *strides,
|
||||
const uint32_t *offsets,
|
||||
const uint64_t *modifiers,
|
||||
GError **error);
|
||||
|
||||
EGLSurface meta_egl_create_window_surface (MetaEgl *egl,
|
||||
EGLDisplay display,
|
||||
EGLConfig config,
|
||||
|
@@ -144,4 +144,7 @@ WacomDevice * meta_input_settings_get_tablet_wacom_device (MetaInputSettings *se
|
||||
ClutterInputDevice *device);
|
||||
#endif
|
||||
|
||||
void meta_input_settings_maybe_save_numlock_state (MetaInputSettings *input_settings);
|
||||
void meta_input_settings_maybe_restore_numlock_state (MetaInputSettings *input_settings);
|
||||
|
||||
#endif /* META_INPUT_SETTINGS_PRIVATE_H */
|
||||
|
@@ -1152,6 +1152,8 @@ meta_input_settings_changed_cb (GSettings *settings,
|
||||
strcmp (key, "repeat-interval") == 0 ||
|
||||
strcmp (key, "delay") == 0)
|
||||
update_keyboard_repeat (input_settings);
|
||||
else if (strcmp (key, "remember-numlock-state") == 0)
|
||||
meta_input_settings_maybe_save_numlock_state (input_settings);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2609,3 +2611,39 @@ meta_input_settings_get_pad_action_label (MetaInputSettings *input_settings,
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
meta_input_settings_maybe_save_numlock_state (MetaInputSettings *input_settings)
|
||||
{
|
||||
MetaInputSettingsPrivate *priv;
|
||||
ClutterKeymap *keymap;
|
||||
gboolean numlock_state;
|
||||
|
||||
priv = meta_input_settings_get_instance_private (input_settings);
|
||||
|
||||
if (!g_settings_get_boolean (priv->keyboard_settings, "remember-numlock-state"))
|
||||
return;
|
||||
|
||||
keymap = clutter_backend_get_keymap (clutter_get_default_backend ());
|
||||
numlock_state = clutter_keymap_get_num_lock_state (keymap);
|
||||
|
||||
if (numlock_state == g_settings_get_boolean (priv->keyboard_settings, "numlock-state"))
|
||||
return;
|
||||
|
||||
g_settings_set_boolean (priv->keyboard_settings, "numlock-state", numlock_state);
|
||||
}
|
||||
|
||||
void
|
||||
meta_input_settings_maybe_restore_numlock_state (MetaInputSettings *input_settings)
|
||||
{
|
||||
MetaInputSettingsPrivate *priv;
|
||||
gboolean numlock_state;
|
||||
|
||||
priv = meta_input_settings_get_instance_private (input_settings);
|
||||
|
||||
if (!g_settings_get_boolean (priv->keyboard_settings, "remember-numlock-state"))
|
||||
return;
|
||||
|
||||
numlock_state = g_settings_get_boolean (priv->keyboard_settings, "numlock-state");
|
||||
meta_backend_set_numlock (meta_get_backend (), numlock_state);
|
||||
}
|
||||
|
@@ -145,15 +145,7 @@ append_monitor (MetaMonitorManager *manager,
|
||||
const char *mode_specs_str;
|
||||
GList *l;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (default_specs); i++)
|
||||
{
|
||||
CrtcModeSpec *spec;
|
||||
|
||||
spec = g_memdup (&default_specs[i], sizeof (CrtcModeSpec));
|
||||
mode_specs = g_list_prepend (mode_specs, spec);
|
||||
}
|
||||
|
||||
mode_specs_str = getenv ("MUTTER_DEBUG_DUMMY_MONITORS_SPECS");
|
||||
mode_specs_str = getenv ("MUTTER_DEBUG_DUMMY_MODE_SPECS");
|
||||
if (mode_specs_str && *mode_specs_str != '\0')
|
||||
{
|
||||
g_auto (GStrv) specs = g_strsplit (mode_specs_str, ":", -1);
|
||||
@@ -181,6 +173,16 @@ append_monitor (MetaMonitorManager *manager,
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < G_N_ELEMENTS (default_specs); i++)
|
||||
{
|
||||
CrtcModeSpec *spec;
|
||||
|
||||
spec = g_memdup (&default_specs[i], sizeof (CrtcModeSpec));
|
||||
mode_specs = g_list_prepend (mode_specs, spec);
|
||||
}
|
||||
}
|
||||
|
||||
for (l = mode_specs; l; l = l->next)
|
||||
{
|
||||
@@ -395,10 +397,11 @@ meta_monitor_manager_dummy_read_current (MetaMonitorManager *manager)
|
||||
* Specifies the number of dummy monitors to include in the stage. Every
|
||||
* monitor is 1024x786 pixels and they are placed on a horizontal row.
|
||||
*
|
||||
* MUTTER_DEBUG_DUMMY_MONITORS_SPECS
|
||||
* MUTTER_DEBUG_DUMMY_MODE_SPECS
|
||||
*
|
||||
* A colon separated list of monitor specifications that can be used to
|
||||
* configure the monitor via dbus API.
|
||||
* A colon separated list of mode specifications that can be used to
|
||||
* configure the monitor via dbus API. Setting this environment variable
|
||||
* overrides the default set of modes available.
|
||||
* Format should be WWxHH:WWxHH@RR
|
||||
*
|
||||
* MUTTER_DEBUG_DUMMY_MONITOR_SCALES
|
||||
|
@@ -385,4 +385,7 @@ void meta_monitor_manager_clear_crtc (MetaCrtc *crtc);
|
||||
|
||||
gboolean meta_monitor_has_aspect_as_size (MetaMonitor *monitor);
|
||||
|
||||
char * meta_monitor_manager_get_vendor_name (MetaMonitorManager *manager,
|
||||
const char *vendor);
|
||||
|
||||
#endif /* META_MONITOR_MANAGER_PRIVATE_H */
|
||||
|
@@ -345,6 +345,9 @@ meta_monitor_manager_power_save_mode_changed (MetaMonitorManager *manager,
|
||||
MetaMonitorManagerPrivate *priv =
|
||||
meta_monitor_manager_get_instance_private (manager);
|
||||
|
||||
if (priv->power_save_mode == mode)
|
||||
return;
|
||||
|
||||
priv->power_save_mode = mode;
|
||||
g_signal_emit (manager, signals[POWER_SAVE_MODE_CHANGED], 0);
|
||||
}
|
||||
@@ -921,29 +924,6 @@ meta_monitor_manager_class_init (MetaMonitorManagerClass *klass)
|
||||
g_object_class_install_properties (object_class, PROP_LAST, obj_props);
|
||||
}
|
||||
|
||||
static const double known_diagonals[] = {
|
||||
12.1,
|
||||
13.3,
|
||||
15.6
|
||||
};
|
||||
|
||||
static char *
|
||||
diagonal_to_str (double d)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (known_diagonals); i++)
|
||||
{
|
||||
double delta;
|
||||
|
||||
delta = fabs(known_diagonals[i] - d);
|
||||
if (delta < 0.1)
|
||||
return g_strdup_printf ("%0.1lf\"", known_diagonals[i]);
|
||||
}
|
||||
|
||||
return g_strdup_printf ("%d\"", (int) (d + 0.5));
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_monitor_has_aspect_as_size (MetaMonitor *monitor)
|
||||
{
|
||||
@@ -960,79 +940,6 @@ meta_monitor_has_aspect_as_size (MetaMonitor *monitor)
|
||||
(width_mm == 16 && height_mm == 10);
|
||||
}
|
||||
|
||||
static char *
|
||||
make_display_name (MetaMonitorManager *manager,
|
||||
MetaMonitor *monitor)
|
||||
{
|
||||
g_autofree char *inches = NULL;
|
||||
g_autofree char *vendor_name = NULL;
|
||||
const char *vendor = NULL;
|
||||
const char *product_name = NULL;
|
||||
int width_mm;
|
||||
int height_mm;
|
||||
|
||||
meta_monitor_get_physical_dimensions (monitor, &width_mm, &height_mm);
|
||||
|
||||
if (meta_monitor_is_laptop_panel (monitor))
|
||||
return g_strdup (_("Built-in display"));
|
||||
|
||||
if (width_mm > 0 && height_mm > 0)
|
||||
{
|
||||
if (!meta_monitor_has_aspect_as_size (monitor))
|
||||
{
|
||||
double d = sqrt (width_mm * width_mm +
|
||||
height_mm * height_mm);
|
||||
inches = diagonal_to_str (d / 25.4);
|
||||
}
|
||||
else
|
||||
{
|
||||
product_name = meta_monitor_get_product (monitor);
|
||||
}
|
||||
}
|
||||
|
||||
vendor = meta_monitor_get_vendor (monitor);
|
||||
|
||||
if (g_strcmp0 (vendor, "unknown") != 0)
|
||||
{
|
||||
if (!manager->pnp_ids)
|
||||
manager->pnp_ids = gnome_pnp_ids_new ();
|
||||
|
||||
vendor_name = gnome_pnp_ids_get_pnp_id (manager->pnp_ids,
|
||||
vendor);
|
||||
|
||||
if (!vendor_name)
|
||||
vendor_name = g_strdup (vendor);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (inches != NULL)
|
||||
vendor_name = g_strdup (_("Unknown"));
|
||||
else
|
||||
vendor_name = g_strdup (_("Unknown Display"));
|
||||
}
|
||||
|
||||
if (inches != NULL)
|
||||
{
|
||||
/**/
|
||||
return g_strdup_printf (C_("This is a monitor vendor name, followed by a "
|
||||
"size in inches, like 'Dell 15\"'",
|
||||
"%s %s"),
|
||||
vendor_name, inches);
|
||||
}
|
||||
else if (product_name != NULL)
|
||||
{
|
||||
return g_strdup_printf (C_("This is a monitor vendor name followed by "
|
||||
"product/model name where size in inches "
|
||||
"could not be calculated, e.g. Dell U2414H",
|
||||
"%s %s"),
|
||||
vendor_name, product_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
return g_strdup (vendor_name);
|
||||
}
|
||||
}
|
||||
|
||||
static const char *
|
||||
get_connector_type_name (MetaConnectorType connector_type)
|
||||
{
|
||||
@@ -1383,7 +1290,7 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
|
||||
GVariantBuilder monitor_properties_builder;
|
||||
GList *k;
|
||||
gboolean is_builtin;
|
||||
char *display_name;
|
||||
const char *display_name;
|
||||
|
||||
current_mode = meta_monitor_get_current_mode (monitor);
|
||||
preferred_mode = meta_monitor_get_preferred_mode (monitor);
|
||||
@@ -1472,10 +1379,10 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
|
||||
"is-builtin",
|
||||
g_variant_new_boolean (is_builtin));
|
||||
|
||||
display_name = make_display_name (manager, monitor);
|
||||
display_name = meta_monitor_get_display_name (monitor);
|
||||
g_variant_builder_add (&monitor_properties_builder, "{sv}",
|
||||
"display-name",
|
||||
g_variant_new_take_string (display_name));
|
||||
g_variant_new_string (display_name));
|
||||
|
||||
g_variant_builder_add (&monitors_builder, MONITOR_FORMAT,
|
||||
monitor_spec->connector,
|
||||
@@ -2734,7 +2641,7 @@ rebuild_monitors (MetaMonitorManager *manager)
|
||||
{
|
||||
MetaMonitorNormal *monitor_normal;
|
||||
|
||||
monitor_normal = meta_monitor_normal_new (gpu, output);
|
||||
monitor_normal = meta_monitor_normal_new (gpu, manager, output);
|
||||
manager->monitors = g_list_append (manager->monitors,
|
||||
monitor_normal);
|
||||
}
|
||||
@@ -3189,3 +3096,23 @@ meta_monitor_manager_get_config_manager (MetaMonitorManager *manager)
|
||||
{
|
||||
return manager->config_manager;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_monitor_manager_get_vendor_name:
|
||||
* @manager: A #MetaMonitorManager object
|
||||
* @vendor: the PNP ID of the monitor
|
||||
*
|
||||
* Find the full vendor name from the given monitor PNP ID.
|
||||
*
|
||||
* Returns: (transfer full): A string containing the vendor name,
|
||||
* or NULL when not found.
|
||||
*/
|
||||
char *
|
||||
meta_monitor_manager_get_vendor_name (MetaMonitorManager *manager,
|
||||
const char *vendor)
|
||||
{
|
||||
if (!manager->pnp_ids)
|
||||
manager->pnp_ids = gnome_pnp_ids_new ();
|
||||
|
||||
return gnome_pnp_ids_get_pnp_id (manager->pnp_ids, vendor);
|
||||
}
|
||||
|
@@ -75,6 +75,8 @@ typedef struct _MetaMonitorPrivate
|
||||
* the primary one).
|
||||
*/
|
||||
uint64_t winsys_id;
|
||||
|
||||
char *display_name;
|
||||
} MetaMonitorPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (MetaMonitor, meta_monitor, G_TYPE_OBJECT)
|
||||
@@ -181,6 +183,99 @@ meta_monitor_generate_spec (MetaMonitor *monitor)
|
||||
priv->spec = monitor_spec;
|
||||
}
|
||||
|
||||
static const double known_diagonals[] = {
|
||||
12.1,
|
||||
13.3,
|
||||
15.6
|
||||
};
|
||||
|
||||
static char *
|
||||
diagonal_to_str (double d)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (known_diagonals); i++)
|
||||
{
|
||||
double delta;
|
||||
|
||||
delta = fabs(known_diagonals[i] - d);
|
||||
if (delta < 0.1)
|
||||
return g_strdup_printf ("%0.1lf\"", known_diagonals[i]);
|
||||
}
|
||||
|
||||
return g_strdup_printf ("%d\"", (int) (d + 0.5));
|
||||
}
|
||||
|
||||
static char *
|
||||
meta_monitor_make_display_name (MetaMonitor *monitor,
|
||||
MetaMonitorManager *monitor_manager)
|
||||
{
|
||||
g_autofree char *inches = NULL;
|
||||
g_autofree char *vendor_name = NULL;
|
||||
const char *vendor = NULL;
|
||||
const char *product_name = NULL;
|
||||
int width_mm;
|
||||
int height_mm;
|
||||
|
||||
meta_monitor_get_physical_dimensions (monitor, &width_mm, &height_mm);
|
||||
|
||||
if (meta_monitor_is_laptop_panel (monitor))
|
||||
return g_strdup (_("Built-in display"));
|
||||
|
||||
if (width_mm > 0 && height_mm > 0)
|
||||
{
|
||||
if (!meta_monitor_has_aspect_as_size (monitor))
|
||||
{
|
||||
double d = sqrt (width_mm * width_mm +
|
||||
height_mm * height_mm);
|
||||
inches = diagonal_to_str (d / 25.4);
|
||||
}
|
||||
else
|
||||
{
|
||||
product_name = meta_monitor_get_product (monitor);
|
||||
}
|
||||
}
|
||||
|
||||
vendor = meta_monitor_get_vendor (monitor);
|
||||
|
||||
if (g_strcmp0 (vendor, "unknown") != 0)
|
||||
{
|
||||
vendor_name = meta_monitor_manager_get_vendor_name (monitor_manager,
|
||||
vendor);
|
||||
|
||||
if (!vendor_name)
|
||||
vendor_name = g_strdup (vendor);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (inches != NULL)
|
||||
vendor_name = g_strdup (_("Unknown"));
|
||||
else
|
||||
vendor_name = g_strdup (_("Unknown Display"));
|
||||
}
|
||||
|
||||
if (inches != NULL)
|
||||
{
|
||||
/**/
|
||||
return g_strdup_printf (C_("This is a monitor vendor name, followed by a "
|
||||
"size in inches, like 'Dell 15\"'",
|
||||
"%s %s"),
|
||||
vendor_name, inches);
|
||||
}
|
||||
else if (product_name != NULL)
|
||||
{
|
||||
return g_strdup_printf (C_("This is a monitor vendor name followed by "
|
||||
"product/model name where size in inches "
|
||||
"could not be calculated, e.g. Dell U2414H",
|
||||
"%s %s"),
|
||||
vendor_name, product_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
return g_strdup (vendor_name);
|
||||
}
|
||||
}
|
||||
|
||||
MetaGpu *
|
||||
meta_monitor_get_gpu (MetaMonitor *monitor)
|
||||
{
|
||||
@@ -410,6 +505,7 @@ meta_monitor_finalize (GObject *object)
|
||||
g_hash_table_destroy (priv->mode_ids);
|
||||
g_list_free_full (priv->modes, (GDestroyNotify) meta_monitor_mode_free);
|
||||
meta_monitor_spec_free (priv->spec);
|
||||
g_free (priv->display_name);
|
||||
|
||||
G_OBJECT_CLASS (meta_monitor_parent_class)->finalize (object);
|
||||
}
|
||||
@@ -551,8 +647,9 @@ meta_monitor_normal_generate_modes (MetaMonitorNormal *monitor_normal)
|
||||
}
|
||||
|
||||
MetaMonitorNormal *
|
||||
meta_monitor_normal_new (MetaGpu *gpu,
|
||||
MetaOutput *output)
|
||||
meta_monitor_normal_new (MetaGpu *gpu,
|
||||
MetaMonitorManager *monitor_manager,
|
||||
MetaOutput *output)
|
||||
{
|
||||
MetaMonitorNormal *monitor_normal;
|
||||
MetaMonitor *monitor;
|
||||
@@ -570,6 +667,9 @@ meta_monitor_normal_new (MetaGpu *gpu,
|
||||
|
||||
meta_monitor_normal_generate_modes (monitor_normal);
|
||||
|
||||
monitor_priv->display_name = meta_monitor_make_display_name (monitor,
|
||||
monitor_manager);
|
||||
|
||||
return monitor_normal;
|
||||
}
|
||||
|
||||
@@ -1208,6 +1308,9 @@ meta_monitor_tiled_new (MetaGpu *gpu,
|
||||
|
||||
meta_monitor_tiled_generate_modes (monitor_tiled);
|
||||
|
||||
monitor_priv->display_name = meta_monitor_make_display_name (monitor,
|
||||
monitor_manager);
|
||||
|
||||
return monitor_tiled;
|
||||
}
|
||||
|
||||
@@ -1765,3 +1868,12 @@ meta_monitor_mode_foreach_output (MetaMonitor *monitor,
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
const char *
|
||||
meta_monitor_get_display_name (MetaMonitor *monitor)
|
||||
{
|
||||
MetaMonitorPrivate *monitor_priv =
|
||||
meta_monitor_get_instance_private (monitor);
|
||||
|
||||
return monitor_priv->display_name;
|
||||
}
|
||||
|
@@ -101,8 +101,9 @@ MetaMonitorTiled * meta_monitor_tiled_new (MetaGpu *gpu,
|
||||
MetaOutput *output);
|
||||
|
||||
META_EXPORT_TEST
|
||||
MetaMonitorNormal * meta_monitor_normal_new (MetaGpu *gpu,
|
||||
MetaOutput *output);
|
||||
MetaMonitorNormal * meta_monitor_normal_new (MetaGpu *gpu,
|
||||
MetaMonitorManager *monitor_manager,
|
||||
MetaOutput *output);
|
||||
|
||||
META_EXPORT_TEST
|
||||
MetaMonitorSpec * meta_monitor_get_spec (MetaMonitor *monitor);
|
||||
@@ -280,4 +281,6 @@ int meta_monitor_spec_compare (MetaMonitorSpec *monitor_spec_a,
|
||||
META_EXPORT_TEST
|
||||
void meta_monitor_spec_free (MetaMonitorSpec *monitor_id);
|
||||
|
||||
const char * meta_monitor_get_display_name (MetaMonitor *monitor);
|
||||
|
||||
#endif /* META_MONITOR_H */
|
||||
|
@@ -31,7 +31,6 @@
|
||||
#include "backends/meta-dbus-session-watcher.h"
|
||||
#include "backends/meta-screen-cast-session.h"
|
||||
#include "backends/meta-remote-access-controller-private.h"
|
||||
#include "backends/native/meta-backend-native.h"
|
||||
#include "backends/x11/meta-backend-x11.h"
|
||||
#include "cogl/cogl.h"
|
||||
#include "meta/meta-backend.h"
|
||||
|
@@ -90,6 +90,12 @@ meta_renderer_create_view (MetaRenderer *renderer,
|
||||
*/
|
||||
void
|
||||
meta_renderer_rebuild_views (MetaRenderer *renderer)
|
||||
{
|
||||
return META_RENDERER_GET_CLASS (renderer)->rebuild_views (renderer);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_renderer_real_rebuild_views (MetaRenderer *renderer)
|
||||
{
|
||||
MetaRendererPrivate *priv = meta_renderer_get_instance_private (renderer);
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
@@ -181,4 +187,6 @@ meta_renderer_class_init (MetaRendererClass *klass)
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = meta_renderer_finalize;
|
||||
|
||||
klass->rebuild_views = meta_renderer_real_rebuild_views;
|
||||
}
|
||||
|
@@ -43,6 +43,7 @@ struct _MetaRendererClass
|
||||
CoglRenderer * (* create_cogl_renderer) (MetaRenderer *renderer);
|
||||
MetaRendererView * (* create_view) (MetaRenderer *renderer,
|
||||
MetaLogicalMonitor *logical_monitor);
|
||||
void (* rebuild_views) (MetaRenderer *renderer);
|
||||
};
|
||||
|
||||
CoglRenderer * meta_renderer_create_cogl_renderer (MetaRenderer *renderer);
|
||||
|
@@ -814,6 +814,7 @@ void meta_backend_native_resume (MetaBackendNative *native)
|
||||
meta_backend_get_monitor_manager (backend);
|
||||
MetaMonitorManagerKms *monitor_manager_kms =
|
||||
META_MONITOR_MANAGER_KMS (monitor_manager);
|
||||
MetaInputSettings *input_settings;
|
||||
MetaIdleMonitor *idle_monitor;
|
||||
|
||||
meta_monitor_manager_kms_resume (monitor_manager_kms);
|
||||
@@ -827,4 +828,7 @@ void meta_backend_native_resume (MetaBackendNative *native)
|
||||
|
||||
idle_monitor = meta_backend_get_idle_monitor (backend, 0);
|
||||
meta_idle_monitor_reset_idletime (idle_monitor);
|
||||
|
||||
input_settings = meta_backend_get_input_settings (backend);
|
||||
meta_input_settings_maybe_restore_numlock_state (input_settings);
|
||||
}
|
||||
|
@@ -40,6 +40,17 @@ struct _MetaKmsCrtc
|
||||
|
||||
G_DEFINE_TYPE (MetaKmsCrtc, meta_kms_crtc, G_TYPE_OBJECT)
|
||||
|
||||
void
|
||||
meta_kms_crtc_set_gamma (MetaKmsCrtc *crtc,
|
||||
MetaKmsUpdate *update,
|
||||
int size,
|
||||
const uint16_t *red,
|
||||
const uint16_t *green,
|
||||
const uint16_t *blue)
|
||||
{
|
||||
meta_kms_update_set_crtc_gamma (update, crtc, size, red, green, blue);
|
||||
}
|
||||
|
||||
MetaKmsDevice *
|
||||
meta_kms_crtc_get_device (MetaKmsCrtc *crtc)
|
||||
{
|
||||
@@ -64,6 +75,36 @@ meta_kms_crtc_get_idx (MetaKmsCrtc *crtc)
|
||||
return crtc->idx;
|
||||
}
|
||||
|
||||
static void
|
||||
read_gamma_state (MetaKmsCrtc *crtc,
|
||||
MetaKmsImplDevice *impl_device,
|
||||
drmModeCrtc *drm_crtc)
|
||||
{
|
||||
MetaKmsCrtcState *current_state = &crtc->current_state;
|
||||
|
||||
if (current_state->gamma.size != drm_crtc->gamma_size)
|
||||
{
|
||||
current_state->gamma.size = drm_crtc->gamma_size;
|
||||
|
||||
current_state->gamma.red = g_realloc_n (current_state->gamma.red,
|
||||
drm_crtc->gamma_size,
|
||||
sizeof (uint16_t));
|
||||
current_state->gamma.green = g_realloc_n (current_state->gamma.green,
|
||||
drm_crtc->gamma_size,
|
||||
sizeof (uint16_t));
|
||||
current_state->gamma.blue = g_realloc_n (current_state->gamma.blue,
|
||||
drm_crtc->gamma_size,
|
||||
sizeof (uint16_t));
|
||||
}
|
||||
|
||||
drmModeCrtcGetGamma (meta_kms_impl_device_get_fd (impl_device),
|
||||
crtc->id,
|
||||
current_state->gamma.size,
|
||||
current_state->gamma.red,
|
||||
current_state->gamma.green,
|
||||
current_state->gamma.blue);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_kms_crtc_read_state (MetaKmsCrtc *crtc,
|
||||
MetaKmsImplDevice *impl_device,
|
||||
@@ -79,6 +120,8 @@ meta_kms_crtc_read_state (MetaKmsCrtc *crtc,
|
||||
.is_drm_mode_valid = drm_crtc->mode_valid,
|
||||
.drm_mode = drm_crtc->mode,
|
||||
};
|
||||
|
||||
read_gamma_state (crtc, impl_device, drm_crtc);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -109,6 +152,18 @@ meta_kms_crtc_new (MetaKmsImplDevice *impl_device,
|
||||
return crtc;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_kms_crtc_finalize (GObject *object)
|
||||
{
|
||||
MetaKmsCrtc *crtc = META_KMS_CRTC (object);
|
||||
|
||||
g_clear_pointer (&crtc->current_state.gamma.red, g_free);
|
||||
g_clear_pointer (&crtc->current_state.gamma.green, g_free);
|
||||
g_clear_pointer (&crtc->current_state.gamma.blue, g_free);
|
||||
|
||||
G_OBJECT_CLASS (meta_kms_crtc_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_kms_crtc_init (MetaKmsCrtc *crtc)
|
||||
{
|
||||
@@ -117,4 +172,7 @@ meta_kms_crtc_init (MetaKmsCrtc *crtc)
|
||||
static void
|
||||
meta_kms_crtc_class_init (MetaKmsCrtcClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = meta_kms_crtc_finalize;
|
||||
}
|
||||
|
@@ -36,6 +36,14 @@ typedef struct _MetaKmsCrtcState
|
||||
uint32_t common_possible_crtcs;
|
||||
uint32_t common_possible_clones;
|
||||
uint32_t encoder_device_idxs;
|
||||
|
||||
struct {
|
||||
uint16_t *red;
|
||||
uint16_t *green;
|
||||
uint16_t *blue;
|
||||
|
||||
int size;
|
||||
} gamma;
|
||||
} MetaKmsCrtcState;
|
||||
|
||||
#define META_TYPE_KMS_CRTC (meta_kms_crtc_get_type ())
|
||||
@@ -43,6 +51,13 @@ G_DECLARE_FINAL_TYPE (MetaKmsCrtc, meta_kms_crtc,
|
||||
META, KMS_CRTC,
|
||||
GObject)
|
||||
|
||||
void meta_kms_crtc_set_gamma (MetaKmsCrtc *crtc,
|
||||
MetaKmsUpdate *update,
|
||||
int size,
|
||||
const uint16_t *red,
|
||||
const uint16_t *green,
|
||||
const uint16_t *blue);
|
||||
|
||||
MetaKmsDevice * meta_kms_crtc_get_device (MetaKmsCrtc *crtc);
|
||||
|
||||
const MetaKmsCrtcState * meta_kms_crtc_get_current_state (MetaKmsCrtc *crtc);
|
||||
|
@@ -156,7 +156,9 @@ create_impl_device_in_impl (MetaKmsImpl *impl,
|
||||
CreateImplDeviceData *data = user_data;
|
||||
MetaKmsImplDevice *impl_device;
|
||||
|
||||
impl_device = meta_kms_impl_device_new (data->device, impl, data->fd);
|
||||
impl_device = meta_kms_impl_device_new (data->device, impl, data->fd, error);
|
||||
if (!impl_device)
|
||||
return FALSE;
|
||||
|
||||
data->out_impl_device = impl_device;
|
||||
data->out_crtcs = meta_kms_impl_device_copy_crtcs (impl_device);
|
||||
|
@@ -307,25 +307,41 @@ meta_kms_impl_device_update_states (MetaKmsImplDevice *impl_device)
|
||||
}
|
||||
|
||||
MetaKmsImplDevice *
|
||||
meta_kms_impl_device_new (MetaKmsDevice *device,
|
||||
MetaKmsImpl *impl,
|
||||
int fd)
|
||||
meta_kms_impl_device_new (MetaKmsDevice *device,
|
||||
MetaKmsImpl *impl,
|
||||
int fd,
|
||||
GError **error)
|
||||
{
|
||||
MetaKms *kms = meta_kms_impl_get_kms (impl);
|
||||
MetaKmsImplDevice *impl_device;
|
||||
int ret;
|
||||
drmModeRes *drm_resources;
|
||||
|
||||
meta_assert_in_kms_impl (kms);
|
||||
|
||||
ret = drmSetClientCap (fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
|
||||
if (ret != 0)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (-ret),
|
||||
"Failed to activate universal planes: %s",
|
||||
g_strerror (-ret));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
drm_resources = drmModeGetResources (fd);
|
||||
if (!drm_resources)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
|
||||
"Failed to activate universal planes: %s",
|
||||
g_strerror (errno));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
impl_device = g_object_new (META_TYPE_KMS_IMPL_DEVICE, NULL);
|
||||
impl_device->device = device;
|
||||
impl_device->impl = impl;
|
||||
impl_device->fd = fd;
|
||||
|
||||
drmSetClientCap (fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
|
||||
|
||||
drm_resources = drmModeGetResources (fd);
|
||||
|
||||
init_crtcs (impl_device, drm_resources);
|
||||
init_connectors (impl_device, drm_resources);
|
||||
init_planes (impl_device);
|
||||
|
@@ -57,8 +57,9 @@ void meta_kms_impl_device_update_states (MetaKmsImplDevice *impl_device);
|
||||
|
||||
int meta_kms_impl_device_close (MetaKmsImplDevice *impl_device);
|
||||
|
||||
MetaKmsImplDevice * meta_kms_impl_device_new (MetaKmsDevice *device,
|
||||
MetaKmsImpl *kms_impl,
|
||||
int fd);
|
||||
MetaKmsImplDevice * meta_kms_impl_device_new (MetaKmsDevice *device,
|
||||
MetaKmsImpl *kms_impl,
|
||||
int fd,
|
||||
GError **error);
|
||||
|
||||
#endif /* META_KMS_IMPL_DEVICE_H */
|
||||
|
@@ -201,7 +201,7 @@ process_mode_set (MetaKmsImpl *impl,
|
||||
GError **error)
|
||||
{
|
||||
MetaKmsImplSimple *impl_simple = META_KMS_IMPL_SIMPLE (impl);
|
||||
MetaKmsCrtc *crtc = mode_set->crtc;;
|
||||
MetaKmsCrtc *crtc = mode_set->crtc;
|
||||
MetaKmsDevice *device = meta_kms_crtc_get_device (crtc);
|
||||
MetaKmsImplDevice *impl_device = meta_kms_device_get_impl_device (device);
|
||||
g_autofree uint32_t *connectors = NULL;
|
||||
@@ -284,6 +284,35 @@ process_mode_set (MetaKmsImpl *impl,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
process_crtc_gamma (MetaKmsImpl *impl,
|
||||
MetaKmsCrtcGamma *gamma,
|
||||
GError **error)
|
||||
{
|
||||
MetaKmsCrtc *crtc = gamma->crtc;
|
||||
MetaKmsDevice *device = meta_kms_crtc_get_device (crtc);
|
||||
MetaKmsImplDevice *impl_device = meta_kms_device_get_impl_device (device);
|
||||
int fd;
|
||||
int ret;
|
||||
|
||||
fd = meta_kms_impl_device_get_fd (impl_device);
|
||||
ret = drmModeCrtcSetGamma (fd, meta_kms_crtc_get_id (crtc),
|
||||
gamma->size,
|
||||
gamma->red,
|
||||
gamma->green,
|
||||
gamma->blue);
|
||||
if (ret != 0)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (-ret),
|
||||
"drmModeCrtcSetGamma on CRTC %u failed: %s",
|
||||
meta_kms_crtc_get_id (crtc),
|
||||
g_strerror (-ret));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_timestamp_earlier_than (uint64_t ts1,
|
||||
uint64_t ts2)
|
||||
@@ -708,6 +737,14 @@ meta_kms_impl_simple_process_update (MetaKmsImpl *impl,
|
||||
goto discard_page_flips;
|
||||
}
|
||||
|
||||
for (l = meta_kms_update_get_crtc_gammas (update); l; l = l->next)
|
||||
{
|
||||
MetaKmsCrtcGamma *gamma = l->data;
|
||||
|
||||
if (!process_crtc_gamma (impl, gamma, error))
|
||||
goto discard_page_flips;
|
||||
}
|
||||
|
||||
for (l = meta_kms_update_get_page_flips (update); l; l = l->next)
|
||||
{
|
||||
MetaKmsPageFlip *page_flip = l->data;
|
||||
|
@@ -22,6 +22,7 @@
|
||||
|
||||
#include "backends/native/meta-kms-plane.h"
|
||||
|
||||
#include <drm_fourcc.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "backends/meta-monitor-transform.h"
|
||||
@@ -293,9 +294,39 @@ parse_formats (MetaKmsPlane *plane,
|
||||
drmModeFreePropertyBlob (blob);
|
||||
}
|
||||
|
||||
static void
|
||||
set_formats_from_array (MetaKmsPlane *plane,
|
||||
const uint32_t *formats,
|
||||
size_t n_formats)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < n_formats; i++)
|
||||
{
|
||||
g_hash_table_insert (plane->formats_modifiers,
|
||||
GUINT_TO_POINTER (formats[i]), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* In case the DRM driver does not expose a format list for the
|
||||
* primary plane (does not support universal planes nor
|
||||
* IN_FORMATS property), hardcode something that is probably supported.
|
||||
*/
|
||||
static const uint32_t drm_default_formats[] =
|
||||
{
|
||||
/* The format everything should always support by convention */
|
||||
DRM_FORMAT_XRGB8888,
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
/* OpenGL GL_RGBA, GL_UNSIGNED_BYTE format, hopefully supported */
|
||||
DRM_FORMAT_XBGR8888
|
||||
#endif
|
||||
};
|
||||
|
||||
static void
|
||||
init_formats (MetaKmsPlane *plane,
|
||||
MetaKmsImplDevice *impl_device,
|
||||
drmModePlane *drm_plane,
|
||||
drmModeObjectProperties *drm_plane_props)
|
||||
{
|
||||
drmModePropertyPtr prop;
|
||||
@@ -317,6 +348,21 @@ init_formats (MetaKmsPlane *plane,
|
||||
parse_formats (plane, impl_device, blob_id);
|
||||
drmModeFreeProperty (prop);
|
||||
}
|
||||
|
||||
if (g_hash_table_size (plane->formats_modifiers) == 0)
|
||||
{
|
||||
set_formats_from_array (plane,
|
||||
drm_plane->formats,
|
||||
drm_plane->count_formats);
|
||||
}
|
||||
|
||||
/* final formats fallback to something hardcoded */
|
||||
if (g_hash_table_size (plane->formats_modifiers) == 0)
|
||||
{
|
||||
set_formats_from_array (plane,
|
||||
drm_default_formats,
|
||||
G_N_ELEMENTS (drm_default_formats));
|
||||
}
|
||||
}
|
||||
|
||||
MetaKmsPlane *
|
||||
@@ -334,7 +380,7 @@ meta_kms_plane_new (MetaKmsPlaneType type,
|
||||
plane->device = meta_kms_impl_device_get_device (impl_device);
|
||||
|
||||
init_rotations (plane, impl_device, drm_plane_props);
|
||||
init_formats (plane, impl_device, drm_plane_props);
|
||||
init_formats (plane, impl_device, drm_plane, drm_plane_props);
|
||||
|
||||
return plane;
|
||||
}
|
||||
|
@@ -59,6 +59,15 @@ typedef struct _MetaKmsConnectorProperty
|
||||
uint64_t value;
|
||||
} MetaKmsConnectorProperty;
|
||||
|
||||
typedef struct _MetaKmsCrtcGamma
|
||||
{
|
||||
MetaKmsCrtc *crtc;
|
||||
int size;
|
||||
uint16_t *red;
|
||||
uint16_t *green;
|
||||
uint16_t *blue;
|
||||
} MetaKmsCrtcGamma;
|
||||
|
||||
typedef struct _MetaKmsPageFlip
|
||||
{
|
||||
MetaKmsCrtc *crtc;
|
||||
@@ -77,6 +86,13 @@ void meta_kms_update_set_connector_property (MetaKmsUpdate *update,
|
||||
uint32_t prop_id,
|
||||
uint64_t value);
|
||||
|
||||
void meta_kms_update_set_crtc_gamma (MetaKmsUpdate *update,
|
||||
MetaKmsCrtc *crtc,
|
||||
int size,
|
||||
const uint16_t *red,
|
||||
const uint16_t *green,
|
||||
const uint16_t *blue);
|
||||
|
||||
void meta_kms_plane_assignment_set_plane_property (MetaKmsPlaneAssignment *plane_assignment,
|
||||
uint32_t prop_id,
|
||||
uint64_t value);
|
||||
@@ -89,6 +105,8 @@ GList * meta_kms_update_get_page_flips (MetaKmsUpdate *update);
|
||||
|
||||
GList * meta_kms_update_get_connector_properties (MetaKmsUpdate *update);
|
||||
|
||||
GList * meta_kms_update_get_crtc_gammas (MetaKmsUpdate *update);
|
||||
|
||||
gboolean meta_kms_update_has_mode_set (MetaKmsUpdate *update);
|
||||
|
||||
#endif /* META_KMS_UPDATE_PRIVATE_H */
|
||||
|
@@ -34,6 +34,7 @@ struct _MetaKmsUpdate
|
||||
GList *plane_assignments;
|
||||
GList *page_flips;
|
||||
GList *connector_properties;
|
||||
GList *crtc_gammas;
|
||||
};
|
||||
|
||||
static MetaKmsProperty *
|
||||
@@ -142,6 +143,39 @@ meta_kms_update_set_connector_property (MetaKmsUpdate *update,
|
||||
prop);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_kms_crtc_gamma_free (MetaKmsCrtcGamma *gamma)
|
||||
{
|
||||
g_free (gamma->red);
|
||||
g_free (gamma->green);
|
||||
g_free (gamma->blue);
|
||||
g_free (gamma);
|
||||
}
|
||||
|
||||
void
|
||||
meta_kms_update_set_crtc_gamma (MetaKmsUpdate *update,
|
||||
MetaKmsCrtc *crtc,
|
||||
int size,
|
||||
const uint16_t *red,
|
||||
const uint16_t *green,
|
||||
const uint16_t *blue)
|
||||
{
|
||||
MetaKmsCrtcGamma *gamma;
|
||||
|
||||
g_assert (!meta_kms_update_is_sealed (update));
|
||||
|
||||
gamma = g_new0 (MetaKmsCrtcGamma, 1);
|
||||
*gamma = (MetaKmsCrtcGamma) {
|
||||
.crtc = crtc,
|
||||
.size = size,
|
||||
.red = g_memdup (red, size * sizeof *red),
|
||||
.green = g_memdup (green, size * sizeof *green),
|
||||
.blue = g_memdup (blue, size * sizeof *blue),
|
||||
};
|
||||
|
||||
update->crtc_gammas = g_list_prepend (update->crtc_gammas, gamma);
|
||||
}
|
||||
|
||||
void
|
||||
meta_kms_update_page_flip (MetaKmsUpdate *update,
|
||||
MetaKmsCrtc *crtc,
|
||||
@@ -225,6 +259,12 @@ meta_kms_update_get_connector_properties (MetaKmsUpdate *update)
|
||||
return update->connector_properties;
|
||||
}
|
||||
|
||||
GList *
|
||||
meta_kms_update_get_crtc_gammas (MetaKmsUpdate *update)
|
||||
{
|
||||
return update->crtc_gammas;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_kms_update_has_mode_set (MetaKmsUpdate *update)
|
||||
{
|
||||
@@ -258,6 +298,7 @@ meta_kms_update_free (MetaKmsUpdate *update)
|
||||
(GDestroyNotify) meta_kms_mode_set_free);
|
||||
g_list_free_full (update->page_flips, g_free);
|
||||
g_list_free_full (update->connector_properties, g_free);
|
||||
g_list_free_full (update->crtc_gammas, (GDestroyNotify) meta_kms_crtc_gamma_free);
|
||||
|
||||
g_free (update);
|
||||
}
|
||||
|
@@ -367,20 +367,16 @@ meta_monitor_manager_kms_get_crtc_gamma (MetaMonitorManager *manager,
|
||||
unsigned short **green,
|
||||
unsigned short **blue)
|
||||
{
|
||||
MetaGpu *gpu = meta_crtc_get_gpu (crtc);
|
||||
int kms_fd = meta_gpu_kms_get_fd (META_GPU_KMS (gpu));
|
||||
drmModeCrtc *kms_crtc;
|
||||
MetaKmsCrtc *kms_crtc;
|
||||
const MetaKmsCrtcState *crtc_state;
|
||||
|
||||
kms_crtc = drmModeGetCrtc (kms_fd, crtc->crtc_id);
|
||||
kms_crtc = meta_crtc_kms_get_kms_crtc (crtc);
|
||||
crtc_state = meta_kms_crtc_get_current_state (kms_crtc);
|
||||
|
||||
*size = kms_crtc->gamma_size;
|
||||
*red = g_new (unsigned short, *size);
|
||||
*green = g_new (unsigned short, *size);
|
||||
*blue = g_new (unsigned short, *size);
|
||||
|
||||
drmModeCrtcGetGamma (kms_fd, crtc->crtc_id, *size, *red, *green, *blue);
|
||||
|
||||
drmModeFreeCrtc (kms_crtc);
|
||||
*size = crtc_state->gamma.size;
|
||||
*red = g_memdup (crtc_state->gamma.red, *size * sizeof **red);
|
||||
*green = g_memdup (crtc_state->gamma.green, *size * sizeof **green);
|
||||
*blue = g_memdup (crtc_state->gamma.blue, *size * sizeof **blue);
|
||||
}
|
||||
|
||||
static char *
|
||||
@@ -453,20 +449,25 @@ meta_monitor_manager_kms_set_crtc_gamma (MetaMonitorManager *manager,
|
||||
unsigned short *green,
|
||||
unsigned short *blue)
|
||||
{
|
||||
MetaGpu *gpu = meta_crtc_get_gpu (crtc);
|
||||
int kms_fd = meta_gpu_kms_get_fd (META_GPU_KMS (gpu));
|
||||
MetaBackend *backend = meta_monitor_manager_get_backend (manager);
|
||||
MetaBackendNative *backend_native = META_BACKEND_NATIVE (backend);
|
||||
MetaKms *kms = meta_backend_native_get_kms (backend_native);
|
||||
MetaKmsCrtc *kms_crtc;
|
||||
g_autofree char *gamma_ramp_string = NULL;
|
||||
int ret;
|
||||
MetaKmsUpdate *kms_update;
|
||||
g_autoptr (GError) error = NULL;
|
||||
|
||||
gamma_ramp_string = generate_gamma_ramp_string (size, red, green, blue);
|
||||
g_debug ("Setting CRTC (%ld) gamma to %s", crtc->crtc_id, gamma_ramp_string);
|
||||
|
||||
ret = drmModeCrtcSetGamma (kms_fd, crtc->crtc_id, size, red, green, blue);
|
||||
if (ret != 0)
|
||||
{
|
||||
g_warning ("Failed to set CRTC (%ld) Gamma: %s",
|
||||
crtc->crtc_id, g_strerror (-ret));
|
||||
}
|
||||
kms_update = meta_kms_ensure_pending_update (kms);
|
||||
|
||||
kms_crtc = meta_crtc_kms_get_kms_crtc (crtc);
|
||||
meta_kms_crtc_set_gamma (kms_crtc, kms_update,
|
||||
size, red, green, blue);
|
||||
|
||||
if (!meta_kms_post_pending_update_sync (kms, &error))
|
||||
g_warning ("Failed to CRTC gamma: %s", error->message);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -45,101 +45,6 @@
|
||||
#error "Somehow included OpenGL headers when we shouldn't have"
|
||||
#endif
|
||||
|
||||
static EGLImageKHR
|
||||
create_egl_image (MetaEgl *egl,
|
||||
EGLDisplay egl_display,
|
||||
EGLContext egl_context,
|
||||
unsigned int width,
|
||||
unsigned int height,
|
||||
uint32_t n_planes,
|
||||
uint32_t *strides,
|
||||
uint32_t *offsets,
|
||||
uint64_t *modifiers,
|
||||
uint32_t format,
|
||||
int fd,
|
||||
GError **error)
|
||||
{
|
||||
EGLint attribs[37];
|
||||
int atti = 0;
|
||||
gboolean has_modifier;
|
||||
|
||||
/* This requires the Mesa commit in
|
||||
* Mesa 10.3 (08264e5dad4df448e7718e782ad9077902089a07) or
|
||||
* Mesa 10.2.7 (55d28925e6109a4afd61f109e845a8a51bd17652).
|
||||
* Otherwise Mesa closes the fd behind our back and re-importing
|
||||
* will fail.
|
||||
* https://bugs.freedesktop.org/show_bug.cgi?id=76188
|
||||
*/
|
||||
|
||||
attribs[atti++] = EGL_WIDTH;
|
||||
attribs[atti++] = width;
|
||||
attribs[atti++] = EGL_HEIGHT;
|
||||
attribs[atti++] = height;
|
||||
attribs[atti++] = EGL_LINUX_DRM_FOURCC_EXT;
|
||||
attribs[atti++] = format;
|
||||
|
||||
has_modifier = (modifiers[0] != DRM_FORMAT_MOD_INVALID &&
|
||||
modifiers[0] != DRM_FORMAT_MOD_LINEAR);
|
||||
|
||||
if (n_planes > 0)
|
||||
{
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE0_FD_EXT;
|
||||
attribs[atti++] = fd;
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT;
|
||||
attribs[atti++] = offsets[0];
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE0_PITCH_EXT;
|
||||
attribs[atti++] = strides[0];
|
||||
if (has_modifier)
|
||||
{
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT;
|
||||
attribs[atti++] = modifiers[0] & 0xFFFFFFFF;
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT;
|
||||
attribs[atti++] = modifiers[0] >> 32;
|
||||
}
|
||||
}
|
||||
|
||||
if (n_planes > 1)
|
||||
{
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE1_FD_EXT;
|
||||
attribs[atti++] = fd;
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE1_OFFSET_EXT;
|
||||
attribs[atti++] = offsets[1];
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE1_PITCH_EXT;
|
||||
attribs[atti++] = strides[1];
|
||||
if (has_modifier)
|
||||
{
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT;
|
||||
attribs[atti++] = modifiers[1] & 0xFFFFFFFF;
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT;
|
||||
attribs[atti++] = modifiers[1] >> 32;
|
||||
}
|
||||
}
|
||||
|
||||
if (n_planes > 2)
|
||||
{
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE2_FD_EXT;
|
||||
attribs[atti++] = fd;
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE2_OFFSET_EXT;
|
||||
attribs[atti++] = offsets[2];
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE2_PITCH_EXT;
|
||||
attribs[atti++] = strides[2];
|
||||
if (has_modifier)
|
||||
{
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT;
|
||||
attribs[atti++] = modifiers[2] & 0xFFFFFFFF;
|
||||
attribs[atti++] = EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT;
|
||||
attribs[atti++] = modifiers[2] >> 32;
|
||||
}
|
||||
}
|
||||
|
||||
attribs[atti++] = EGL_NONE;
|
||||
|
||||
return meta_egl_create_image (egl, egl_display, EGL_NO_CONTEXT,
|
||||
EGL_LINUX_DMA_BUF_EXT, NULL,
|
||||
attribs,
|
||||
error);
|
||||
}
|
||||
|
||||
static void
|
||||
paint_egl_image (MetaGles3 *gles3,
|
||||
EGLImageKHR egl_image,
|
||||
@@ -195,8 +100,10 @@ meta_renderer_native_gles3_blit_shared_bo (MetaEgl *egl,
|
||||
uint32_t strides[4] = { 0 };
|
||||
uint32_t offsets[4] = { 0 };
|
||||
uint64_t modifiers[4] = { 0 };
|
||||
int fds[4] = { -1, -1, -1, -1 };
|
||||
uint32_t format;
|
||||
EGLImageKHR egl_image;
|
||||
gboolean use_modifiers;
|
||||
|
||||
shared_bo_fd = gbm_bo_get_fd (shared_bo);
|
||||
if (shared_bo_fd < 0)
|
||||
@@ -216,17 +123,27 @@ meta_renderer_native_gles3_blit_shared_bo (MetaEgl *egl,
|
||||
strides[i] = gbm_bo_get_stride_for_plane (shared_bo, i);
|
||||
offsets[i] = gbm_bo_get_offset (shared_bo, i);
|
||||
modifiers[i] = gbm_bo_get_modifier (shared_bo);
|
||||
fds[i] = shared_bo_fd;
|
||||
}
|
||||
|
||||
egl_image = create_egl_image (egl,
|
||||
egl_display,
|
||||
egl_context,
|
||||
width, height,
|
||||
n_planes,
|
||||
strides, offsets,
|
||||
modifiers, format,
|
||||
shared_bo_fd,
|
||||
error);
|
||||
/* Workaround for https://gitlab.gnome.org/GNOME/mutter/issues/18 */
|
||||
if (modifiers[0] == DRM_FORMAT_MOD_LINEAR ||
|
||||
modifiers[0] == DRM_FORMAT_MOD_INVALID)
|
||||
use_modifiers = FALSE;
|
||||
else
|
||||
use_modifiers = TRUE;
|
||||
|
||||
egl_image = meta_egl_create_dmabuf_image (egl,
|
||||
egl_display,
|
||||
width,
|
||||
height,
|
||||
format,
|
||||
n_planes,
|
||||
fds,
|
||||
strides,
|
||||
offsets,
|
||||
use_modifiers ? modifiers : NULL,
|
||||
error);
|
||||
close (shared_bo_fd);
|
||||
|
||||
if (!egl_image)
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* Copyright (C) 2011 Intel Corporation.
|
||||
* Copyright (C) 2016 Red Hat
|
||||
* Copyright (c) 2018 DisplayLink (UK) Ltd.
|
||||
* Copyright (c) 2018,2019 DisplayLink (UK) Ltd.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
@@ -69,6 +69,8 @@
|
||||
#include "backends/native/meta-renderer-native-gles3.h"
|
||||
#include "backends/native/meta-renderer-native.h"
|
||||
#include "cogl/cogl.h"
|
||||
#include "cogl/cogl-framebuffer.h"
|
||||
#include "cogl/cogl-trace.h"
|
||||
#include "core/boxes-private.h"
|
||||
|
||||
#ifndef EGL_DRM_MASTER_FD_EXT
|
||||
@@ -93,8 +95,14 @@ static GParamSpec *obj_props[PROP_LAST];
|
||||
|
||||
typedef enum _MetaSharedFramebufferCopyMode
|
||||
{
|
||||
META_SHARED_FRAMEBUFFER_COPY_MODE_GPU,
|
||||
META_SHARED_FRAMEBUFFER_COPY_MODE_CPU
|
||||
/* the secondary GPU will make the copy */
|
||||
META_SHARED_FRAMEBUFFER_COPY_MODE_SECONDARY_GPU,
|
||||
/*
|
||||
* The copy is made in the primary GPU rendering context, either
|
||||
* as a CPU copy through Cogl read-pixels or as primary GPU copy
|
||||
* using glBlitFramebuffer.
|
||||
*/
|
||||
META_SHARED_FRAMEBUFFER_COPY_MODE_PRIMARY
|
||||
} MetaSharedFramebufferCopyMode;
|
||||
|
||||
typedef struct _MetaRendererNativeGpuData
|
||||
@@ -121,6 +129,7 @@ typedef struct _MetaRendererNativeGpuData
|
||||
struct {
|
||||
MetaSharedFramebufferCopyMode copy_mode;
|
||||
gboolean is_hardware_rendering;
|
||||
gboolean has_EGL_EXT_image_dma_buf_import_modifiers;
|
||||
|
||||
/* For GPU blit mode */
|
||||
EGLContext egl_context;
|
||||
@@ -138,6 +147,7 @@ typedef struct _MetaDumbBuffer
|
||||
int height;
|
||||
int stride_bytes;
|
||||
uint32_t drm_format;
|
||||
int dmabuf_fd;
|
||||
} MetaDumbBuffer;
|
||||
|
||||
typedef struct _MetaOnscreenNativeSecondaryGpuState
|
||||
@@ -159,6 +169,9 @@ typedef struct _MetaOnscreenNativeSecondaryGpuState
|
||||
} cpu;
|
||||
|
||||
int pending_flips;
|
||||
|
||||
gboolean noted_primary_gpu_copy_ok;
|
||||
gboolean noted_primary_gpu_copy_failed;
|
||||
} MetaOnscreenNativeSecondaryGpuState;
|
||||
|
||||
typedef struct _MetaOnscreenNative
|
||||
@@ -240,6 +253,10 @@ init_dumb_fb (MetaDumbBuffer *dumb_fb,
|
||||
uint32_t format,
|
||||
GError **error);
|
||||
|
||||
static int
|
||||
meta_dumb_buffer_ensure_dmabuf_fd (MetaDumbBuffer *dumb_fb,
|
||||
MetaGpuKms *gpu_kms);
|
||||
|
||||
static MetaEgl *
|
||||
meta_renderer_native_get_egl (MetaRendererNative *renderer_native);
|
||||
|
||||
@@ -256,6 +273,9 @@ cogl_pixel_format_from_drm_format (uint32_t drm_format,
|
||||
CoglPixelFormat *out_format,
|
||||
CoglTextureComponents *out_components);
|
||||
|
||||
static void
|
||||
meta_renderer_native_queue_modes_reset (MetaRendererNative *renderer_native);
|
||||
|
||||
static void
|
||||
meta_renderer_native_gpu_data_free (MetaRendererNativeGpuData *renderer_gpu_data)
|
||||
{
|
||||
@@ -867,7 +887,7 @@ init_secondary_gpu_state (MetaRendererNative *renderer_native,
|
||||
|
||||
switch (renderer_gpu_data->secondary.copy_mode)
|
||||
{
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_GPU:
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_SECONDARY_GPU:
|
||||
if (!init_secondary_gpu_state_gpu_copy_mode (renderer_native,
|
||||
onscreen,
|
||||
renderer_gpu_data,
|
||||
@@ -875,7 +895,7 @@ init_secondary_gpu_state (MetaRendererNative *renderer_native,
|
||||
error))
|
||||
return FALSE;
|
||||
break;
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_CPU:
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_PRIMARY:
|
||||
if (!init_secondary_gpu_state_cpu_copy_mode (renderer_native,
|
||||
onscreen,
|
||||
renderer_gpu_data,
|
||||
@@ -959,10 +979,10 @@ free_current_secondary_bo (MetaGpuKms *gpu_kms,
|
||||
renderer_gpu_data = secondary_gpu_state->renderer_gpu_data;
|
||||
switch (renderer_gpu_data->secondary.copy_mode)
|
||||
{
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_GPU:
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_SECONDARY_GPU:
|
||||
g_clear_object (&secondary_gpu_state->gbm.current_fb);
|
||||
break;
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_CPU:
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_PRIMARY:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1450,10 +1470,10 @@ free_next_secondary_bo (MetaGpuKms *gpu_kms,
|
||||
renderer_gpu_data = secondary_gpu_state->renderer_gpu_data;
|
||||
switch (renderer_gpu_data->secondary.copy_mode)
|
||||
{
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_GPU:
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_SECONDARY_GPU:
|
||||
g_clear_object (&secondary_gpu_state->gbm.next_fb);
|
||||
break;
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_CPU:
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_PRIMARY:
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1757,6 +1777,9 @@ copy_shared_framebuffer_gpu (CoglOnscreen *onscreen,
|
||||
MetaDrmBufferGbm *buffer_gbm;
|
||||
struct gbm_bo *bo;
|
||||
|
||||
COGL_TRACE_BEGIN_SCOPED (CopySharedFramebufferSecondaryGpu,
|
||||
"FB Copy (secondary GPU)");
|
||||
|
||||
if (!meta_egl_make_current (egl,
|
||||
renderer_gpu_data->egl_display,
|
||||
secondary_gpu_state->egl_surface,
|
||||
@@ -1823,6 +1846,131 @@ secondary_gpu_get_next_dumb_buffer (MetaOnscreenNativeSecondaryGpuState *seconda
|
||||
return &secondary_gpu_state->cpu.dumb_fbs[0];
|
||||
}
|
||||
|
||||
static gboolean
|
||||
copy_shared_framebuffer_primary_gpu (CoglOnscreen *onscreen,
|
||||
MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state)
|
||||
{
|
||||
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
|
||||
CoglContext *cogl_context = framebuffer->context;
|
||||
CoglOnscreenEGL *onscreen_egl = onscreen->winsys;
|
||||
MetaOnscreenNative *onscreen_native = onscreen_egl->platform;
|
||||
CoglDisplay *cogl_display = cogl_context->display;
|
||||
CoglRenderer *cogl_renderer = cogl_display->renderer;
|
||||
CoglRendererEGL *cogl_renderer_egl = cogl_renderer->winsys;
|
||||
EGLDisplay egl_display = cogl_renderer_egl->edpy;
|
||||
MetaRendererNative *renderer_native = onscreen_native->renderer_native;
|
||||
MetaEgl *egl = meta_renderer_native_get_egl (renderer_native);
|
||||
MetaRendererNativeGpuData *primary_gpu_data;
|
||||
MetaDrmBufferDumb *buffer_dumb;
|
||||
MetaDumbBuffer *dumb_fb;
|
||||
int dmabuf_fd;
|
||||
EGLImageKHR egl_image;
|
||||
g_autoptr (GError) error = NULL;
|
||||
uint32_t strides[1];
|
||||
uint32_t offsets[1];
|
||||
uint64_t modifiers[1];
|
||||
CoglPixelFormat cogl_format;
|
||||
CoglEglImageFlags flags;
|
||||
CoglTexture2D *cogl_tex;
|
||||
CoglOffscreen *cogl_fbo;
|
||||
int ret;
|
||||
|
||||
COGL_TRACE_BEGIN_SCOPED (CopySharedFramebufferPrimaryGpu,
|
||||
"FB Copy (primary GPU)");
|
||||
|
||||
primary_gpu_data = meta_renderer_native_get_gpu_data (renderer_native,
|
||||
renderer_native->primary_gpu_kms);
|
||||
if (!primary_gpu_data->secondary.has_EGL_EXT_image_dma_buf_import_modifiers)
|
||||
return FALSE;
|
||||
|
||||
dumb_fb = secondary_gpu_get_next_dumb_buffer (secondary_gpu_state);
|
||||
|
||||
g_assert (cogl_framebuffer_get_width (framebuffer) == dumb_fb->width);
|
||||
g_assert (cogl_framebuffer_get_height (framebuffer) == dumb_fb->height);
|
||||
|
||||
ret = cogl_pixel_format_from_drm_format (dumb_fb->drm_format,
|
||||
&cogl_format,
|
||||
NULL);
|
||||
g_assert (ret);
|
||||
|
||||
dmabuf_fd = meta_dumb_buffer_ensure_dmabuf_fd (dumb_fb,
|
||||
secondary_gpu_state->gpu_kms);
|
||||
if (dmabuf_fd == -1)
|
||||
return FALSE;
|
||||
|
||||
strides[0] = dumb_fb->stride_bytes;
|
||||
offsets[0] = 0;
|
||||
modifiers[0] = DRM_FORMAT_MOD_LINEAR;
|
||||
egl_image = meta_egl_create_dmabuf_image (egl,
|
||||
egl_display,
|
||||
dumb_fb->width,
|
||||
dumb_fb->height,
|
||||
dumb_fb->drm_format,
|
||||
1 /* n_planes */,
|
||||
&dmabuf_fd,
|
||||
strides,
|
||||
offsets,
|
||||
modifiers,
|
||||
&error);
|
||||
if (egl_image == EGL_NO_IMAGE_KHR)
|
||||
{
|
||||
g_debug ("%s: Failed to import dumb buffer to EGL: %s",
|
||||
__func__, error->message);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
flags = COGL_EGL_IMAGE_FLAG_NO_GET_DATA;
|
||||
cogl_tex = cogl_egl_texture_2d_new_from_image (cogl_context,
|
||||
dumb_fb->width,
|
||||
dumb_fb->height,
|
||||
cogl_format,
|
||||
egl_image,
|
||||
flags,
|
||||
&error);
|
||||
|
||||
meta_egl_destroy_image (egl, egl_display, egl_image, NULL);
|
||||
|
||||
if (!cogl_tex)
|
||||
{
|
||||
g_debug ("%s: Failed to make Cogl texture: %s",
|
||||
__func__, error->message);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
cogl_fbo = cogl_offscreen_new_with_texture (COGL_TEXTURE (cogl_tex));
|
||||
cogl_object_unref (cogl_tex);
|
||||
|
||||
if (!cogl_framebuffer_allocate (COGL_FRAMEBUFFER (cogl_fbo), &error))
|
||||
{
|
||||
g_debug ("%s: Failed Cogl FBO alloc: %s",
|
||||
__func__, error->message);
|
||||
cogl_object_unref (cogl_fbo);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!cogl_blit_framebuffer (framebuffer, COGL_FRAMEBUFFER (cogl_fbo),
|
||||
0, 0, 0, 0,
|
||||
dumb_fb->width, dumb_fb->height, &error))
|
||||
{
|
||||
g_debug ("%s: Failed Cogl blit: %s", __func__, error->message);
|
||||
cogl_object_unref (cogl_fbo);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
cogl_object_unref (cogl_fbo);
|
||||
|
||||
g_clear_object (&secondary_gpu_state->gbm.next_fb);
|
||||
buffer_dumb = meta_drm_buffer_dumb_new (dumb_fb->fb_id);
|
||||
secondary_gpu_state->gbm.next_fb = META_DRM_BUFFER (buffer_dumb);
|
||||
secondary_gpu_state->cpu.dumb_fb = dumb_fb;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
typedef struct _PixelFormatMap {
|
||||
uint32_t drm_format;
|
||||
CoglPixelFormat cogl_format;
|
||||
@@ -1895,6 +2043,9 @@ copy_shared_framebuffer_cpu (CoglOnscreen *onscreen,
|
||||
gboolean ret;
|
||||
MetaDrmBufferDumb *buffer_dumb;
|
||||
|
||||
COGL_TRACE_BEGIN_SCOPED (CopySharedFramebufferCpu,
|
||||
"FB Copy (CPU)");
|
||||
|
||||
dumb_fb = secondary_gpu_get_next_dumb_buffer (secondary_gpu_state);
|
||||
|
||||
g_assert (cogl_framebuffer_get_width (framebuffer) == dumb_fb->width);
|
||||
@@ -1945,13 +2096,30 @@ update_secondary_gpu_state_pre_swap_buffers (CoglOnscreen *onscreen)
|
||||
renderer_gpu_data = secondary_gpu_state->renderer_gpu_data;
|
||||
switch (renderer_gpu_data->secondary.copy_mode)
|
||||
{
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_GPU:
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_SECONDARY_GPU:
|
||||
/* Done after eglSwapBuffers. */
|
||||
break;
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_CPU:
|
||||
copy_shared_framebuffer_cpu (onscreen,
|
||||
secondary_gpu_state,
|
||||
renderer_gpu_data);
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_PRIMARY:
|
||||
if (!copy_shared_framebuffer_primary_gpu (onscreen,
|
||||
secondary_gpu_state))
|
||||
{
|
||||
if (!secondary_gpu_state->noted_primary_gpu_copy_failed)
|
||||
{
|
||||
g_debug ("Using primary GPU to copy for %s failed once.",
|
||||
meta_gpu_kms_get_file_path (secondary_gpu_state->gpu_kms));
|
||||
secondary_gpu_state->noted_primary_gpu_copy_failed = TRUE;
|
||||
}
|
||||
|
||||
copy_shared_framebuffer_cpu (onscreen,
|
||||
secondary_gpu_state,
|
||||
renderer_gpu_data);
|
||||
}
|
||||
else if (!secondary_gpu_state->noted_primary_gpu_copy_ok)
|
||||
{
|
||||
g_debug ("Using primary GPU to copy for %s succeeded once.",
|
||||
meta_gpu_kms_get_file_path (secondary_gpu_state->gpu_kms));
|
||||
secondary_gpu_state->noted_primary_gpu_copy_ok = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1979,13 +2147,13 @@ update_secondary_gpu_state_post_swap_buffers (CoglOnscreen *onscreen,
|
||||
secondary_gpu_state->gpu_kms);
|
||||
switch (renderer_gpu_data->secondary.copy_mode)
|
||||
{
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_GPU:
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_SECONDARY_GPU:
|
||||
copy_shared_framebuffer_gpu (onscreen,
|
||||
secondary_gpu_state,
|
||||
renderer_gpu_data,
|
||||
egl_context_changed);
|
||||
break;
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_CPU:
|
||||
case META_SHARED_FRAMEBUFFER_COPY_MODE_PRIMARY:
|
||||
/* Done before eglSwapBuffers. */
|
||||
break;
|
||||
}
|
||||
@@ -2458,6 +2626,7 @@ init_dumb_fb (MetaDumbBuffer *dumb_fb,
|
||||
dumb_fb->height = height;
|
||||
dumb_fb->stride_bytes = create_arg.pitch;
|
||||
dumb_fb->drm_format = format;
|
||||
dumb_fb->dmabuf_fd = -1;
|
||||
|
||||
return TRUE;
|
||||
|
||||
@@ -2475,6 +2644,33 @@ err_ioctl:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static int
|
||||
meta_dumb_buffer_ensure_dmabuf_fd (MetaDumbBuffer *dumb_fb,
|
||||
MetaGpuKms *gpu_kms)
|
||||
{
|
||||
int ret;
|
||||
int kms_fd;
|
||||
int dmabuf_fd;
|
||||
|
||||
if (dumb_fb->dmabuf_fd != -1)
|
||||
return dumb_fb->dmabuf_fd;
|
||||
|
||||
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
|
||||
|
||||
ret = drmPrimeHandleToFD (kms_fd, dumb_fb->handle, DRM_CLOEXEC,
|
||||
&dmabuf_fd);
|
||||
if (ret)
|
||||
{
|
||||
g_debug ("Failed to export dumb drm buffer: %s",
|
||||
g_strerror (errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
dumb_fb->dmabuf_fd = dmabuf_fd;
|
||||
|
||||
return dumb_fb->dmabuf_fd;
|
||||
}
|
||||
|
||||
static void
|
||||
release_dumb_fb (MetaDumbBuffer *dumb_fb,
|
||||
MetaGpuKms *gpu_kms)
|
||||
@@ -2485,6 +2681,9 @@ release_dumb_fb (MetaDumbBuffer *dumb_fb,
|
||||
if (!dumb_fb->map)
|
||||
return;
|
||||
|
||||
if (dumb_fb->dmabuf_fd != -1)
|
||||
close (dumb_fb->dmabuf_fd);
|
||||
|
||||
munmap (dumb_fb->map, dumb_fb->map_size);
|
||||
dumb_fb->map = NULL;
|
||||
|
||||
@@ -2633,8 +2832,6 @@ meta_renderer_native_release_onscreen (CoglOnscreen *onscreen)
|
||||
CoglContext *cogl_context = framebuffer->context;
|
||||
CoglDisplay *cogl_display = cogl_context_get_display (cogl_context);
|
||||
CoglDisplayEGL *cogl_display_egl = cogl_display->winsys;
|
||||
CoglRenderer *cogl_renderer = cogl_context->display->renderer;
|
||||
CoglRendererEGL *cogl_renderer_egl = cogl_renderer->winsys;
|
||||
CoglOnscreenEGL *onscreen_egl = onscreen->winsys;
|
||||
MetaOnscreenNative *onscreen_native;
|
||||
MetaRendererNative *renderer_native;
|
||||
@@ -2688,6 +2885,8 @@ meta_renderer_native_release_onscreen (CoglOnscreen *onscreen)
|
||||
if (onscreen_native->egl.stream != EGL_NO_STREAM_KHR)
|
||||
{
|
||||
MetaEgl *egl = meta_onscreen_native_get_egl (onscreen_native);
|
||||
CoglRenderer *cogl_renderer = cogl_context->display->renderer;
|
||||
CoglRendererEGL *cogl_renderer_egl = cogl_renderer->winsys;
|
||||
|
||||
meta_egl_destroy_stream (egl,
|
||||
cogl_renderer_egl->edpy,
|
||||
@@ -2743,7 +2942,7 @@ meta_renderer_native_supports_mirroring (MetaRendererNative *renderer_native)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
meta_renderer_native_queue_modes_reset (MetaRendererNative *renderer_native)
|
||||
{
|
||||
MetaRenderer *renderer = META_RENDERER (renderer_native);
|
||||
@@ -3110,6 +3309,23 @@ meta_renderer_native_create_view (MetaRenderer *renderer,
|
||||
return view;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_renderer_native_rebuild_views (MetaRenderer *renderer)
|
||||
{
|
||||
MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer);
|
||||
MetaBackendNative *backend_native =
|
||||
META_BACKEND_NATIVE (renderer_native->backend);
|
||||
MetaKms *kms = meta_backend_native_get_kms (backend_native);
|
||||
MetaRendererClass *parent_renderer_class =
|
||||
META_RENDERER_CLASS (meta_renderer_native_parent_class);
|
||||
|
||||
meta_kms_discard_pending_page_flips (kms);
|
||||
|
||||
parent_renderer_class->rebuild_views (renderer);
|
||||
|
||||
meta_renderer_native_queue_modes_reset (META_RENDERER_NATIVE (renderer));
|
||||
}
|
||||
|
||||
void
|
||||
meta_renderer_native_finish_frame (MetaRendererNative *renderer_native)
|
||||
{
|
||||
@@ -3340,7 +3556,12 @@ init_secondary_gpu_data_gpu (MetaRendererNativeGpuData *renderer_gpu_data,
|
||||
renderer_gpu_data->secondary.is_hardware_rendering = TRUE;
|
||||
renderer_gpu_data->secondary.egl_context = egl_context;
|
||||
renderer_gpu_data->secondary.egl_config = egl_config;
|
||||
renderer_gpu_data->secondary.copy_mode = META_SHARED_FRAMEBUFFER_COPY_MODE_GPU;
|
||||
renderer_gpu_data->secondary.copy_mode = META_SHARED_FRAMEBUFFER_COPY_MODE_SECONDARY_GPU;
|
||||
|
||||
renderer_gpu_data->secondary.has_EGL_EXT_image_dma_buf_import_modifiers =
|
||||
meta_egl_has_extensions (egl, egl_display, NULL,
|
||||
"EGL_EXT_image_dma_buf_import_modifiers",
|
||||
NULL);
|
||||
|
||||
return TRUE;
|
||||
|
||||
@@ -3360,7 +3581,7 @@ static void
|
||||
init_secondary_gpu_data_cpu (MetaRendererNativeGpuData *renderer_gpu_data)
|
||||
{
|
||||
renderer_gpu_data->secondary.is_hardware_rendering = FALSE;
|
||||
renderer_gpu_data->secondary.copy_mode = META_SHARED_FRAMEBUFFER_COPY_MODE_CPU;
|
||||
renderer_gpu_data->secondary.copy_mode = META_SHARED_FRAMEBUFFER_COPY_MODE_PRIMARY;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3934,6 +4155,7 @@ meta_renderer_native_class_init (MetaRendererNativeClass *klass)
|
||||
|
||||
renderer_class->create_cogl_renderer = meta_renderer_native_create_cogl_renderer;
|
||||
renderer_class->create_view = meta_renderer_native_create_view;
|
||||
renderer_class->rebuild_views = meta_renderer_native_rebuild_views;
|
||||
|
||||
obj_props[PROP_BACKEND] =
|
||||
g_param_spec_object ("backend",
|
||||
|
@@ -53,20 +53,6 @@ struct gbm_device * meta_gbm_device_from_gpu (MetaGpuKms *gpu_kms);
|
||||
|
||||
gboolean meta_renderer_native_supports_mirroring (MetaRendererNative *renderer_native);
|
||||
|
||||
void meta_renderer_native_queue_modes_reset (MetaRendererNative *renderer_native);
|
||||
|
||||
gboolean meta_renderer_native_set_legacy_view_size (MetaRendererNative *renderer_native,
|
||||
MetaRendererView *view,
|
||||
int width,
|
||||
int height,
|
||||
GError **error);
|
||||
|
||||
void meta_renderer_native_set_ignore_crtc (MetaRendererNative *renderer_native,
|
||||
uint32_t id,
|
||||
gboolean ignore);
|
||||
|
||||
MetaRendererView * meta_renderer_native_create_legacy_view (MetaRendererNative *renderer_native);
|
||||
|
||||
void meta_renderer_native_finish_frame (MetaRendererNative *renderer_native);
|
||||
|
||||
int64_t meta_renderer_native_get_frame_counter (MetaRendererNative *renderer_native);
|
||||
|
@@ -140,7 +140,6 @@ meta_stage_native_rebuild_views (MetaStageNative *stage_native)
|
||||
ClutterActor *stage = meta_backend_get_stage (backend);
|
||||
|
||||
meta_renderer_rebuild_views (renderer);
|
||||
meta_renderer_native_queue_modes_reset (META_RENDERER_NATIVE (renderer));
|
||||
clutter_stage_update_resource_scales (CLUTTER_STAGE (stage));
|
||||
ensure_frame_callbacks (stage_native);
|
||||
}
|
||||
|
@@ -667,7 +667,13 @@ static void
|
||||
meta_backend_x11_set_numlock (MetaBackend *backend,
|
||||
gboolean numlock_state)
|
||||
{
|
||||
/* TODO: Currently handled by gnome-settings-deamon */
|
||||
MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
|
||||
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
|
||||
unsigned int num_mask;
|
||||
|
||||
num_mask = XkbKeysymToModifiers (priv->xdisplay, XK_Num_Lock);
|
||||
XkbLockModifiers (priv->xdisplay, XkbUseCoreKbd, num_mask,
|
||||
numlock_state ? num_mask : 0);
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -33,6 +33,7 @@ struct _MetaCompositor
|
||||
CoglContext *context;
|
||||
|
||||
MetaWindowActor *top_window_actor;
|
||||
gulong top_window_actor_destroy_id;
|
||||
|
||||
/* Used for unredirecting fullscreen windows */
|
||||
guint disable_unredirect_count;
|
||||
|
@@ -149,10 +149,10 @@ meta_compositor_destroy (MetaCompositor *compositor)
|
||||
|
||||
if (compositor->top_window_actor)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (compositor->top_window_actor,
|
||||
on_top_window_actor_destroyed,
|
||||
compositor);
|
||||
g_signal_handler_disconnect (compositor->top_window_actor,
|
||||
compositor->top_window_actor_destroy_id);
|
||||
compositor->top_window_actor = NULL;
|
||||
compositor->top_window_actor_destroy_id = 0;
|
||||
}
|
||||
|
||||
g_clear_pointer (&compositor->window_group, clutter_actor_destroy);
|
||||
@@ -778,18 +778,6 @@ meta_compositor_window_opacity_changed (MetaCompositor *compositor,
|
||||
meta_window_actor_update_opacity (window_actor);
|
||||
}
|
||||
|
||||
void
|
||||
meta_compositor_window_surface_changed (MetaCompositor *compositor,
|
||||
MetaWindow *window)
|
||||
{
|
||||
MetaWindowActor *window_actor;
|
||||
window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
|
||||
if (!window_actor)
|
||||
return;
|
||||
|
||||
meta_window_actor_update_surface (window_actor);
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_compositor_process_event: (skip)
|
||||
* @compositor:
|
||||
@@ -844,7 +832,7 @@ meta_compositor_filter_keybinding (MetaCompositor *compositor,
|
||||
|
||||
void
|
||||
meta_compositor_show_window (MetaCompositor *compositor,
|
||||
MetaWindow *window,
|
||||
MetaWindow *window,
|
||||
MetaCompEffect effect)
|
||||
{
|
||||
MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
|
||||
@@ -1025,6 +1013,7 @@ on_top_window_actor_destroyed (MetaWindowActor *window_actor,
|
||||
MetaCompositor *compositor)
|
||||
{
|
||||
compositor->top_window_actor = NULL;
|
||||
compositor->top_window_actor_destroy_id = 0;
|
||||
compositor->windows = g_list_remove (compositor->windows, window_actor);
|
||||
|
||||
meta_stack_tracker_queue_sync_stack (compositor->display->stack_tracker);
|
||||
@@ -1032,8 +1021,9 @@ on_top_window_actor_destroyed (MetaWindowActor *window_actor,
|
||||
|
||||
void
|
||||
meta_compositor_sync_stack (MetaCompositor *compositor,
|
||||
GList *stack)
|
||||
GList *stack)
|
||||
{
|
||||
MetaWindowActor *top_window_actor;
|
||||
GList *old_stack;
|
||||
|
||||
/* This is painful because hidden windows that we are in the process
|
||||
@@ -1117,27 +1107,39 @@ meta_compositor_sync_stack (MetaCompositor *compositor,
|
||||
|
||||
sync_actor_stacking (compositor);
|
||||
|
||||
if (compositor->top_window_actor)
|
||||
g_signal_handlers_disconnect_by_func (compositor->top_window_actor,
|
||||
on_top_window_actor_destroyed,
|
||||
compositor);
|
||||
top_window_actor = get_top_visible_window_actor (compositor);
|
||||
|
||||
compositor->top_window_actor = get_top_visible_window_actor (compositor);
|
||||
if (compositor->top_window_actor == top_window_actor)
|
||||
return;
|
||||
|
||||
if (compositor->top_window_actor)
|
||||
g_signal_connect (compositor->top_window_actor, "destroy",
|
||||
G_CALLBACK (on_top_window_actor_destroyed),
|
||||
compositor);
|
||||
{
|
||||
g_signal_handler_disconnect (compositor->top_window_actor,
|
||||
compositor->top_window_actor_destroy_id);
|
||||
compositor->top_window_actor_destroy_id = 0;
|
||||
}
|
||||
|
||||
compositor->top_window_actor = top_window_actor;
|
||||
|
||||
if (compositor->top_window_actor)
|
||||
compositor->top_window_actor_destroy_id =
|
||||
g_signal_connect (compositor->top_window_actor, "destroy",
|
||||
G_CALLBACK (on_top_window_actor_destroyed),
|
||||
compositor);
|
||||
}
|
||||
|
||||
void
|
||||
meta_compositor_sync_window_geometry (MetaCompositor *compositor,
|
||||
MetaWindow *window,
|
||||
gboolean did_placement)
|
||||
MetaWindow *window,
|
||||
gboolean did_placement)
|
||||
{
|
||||
MetaWindowActor *window_actor = META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
|
||||
meta_window_actor_sync_actor_geometry (window_actor, did_placement);
|
||||
meta_plugin_manager_event_size_changed (compositor->plugin_mgr, window_actor);
|
||||
MetaWindowActorChanges changes;
|
||||
|
||||
changes = meta_window_actor_sync_actor_geometry (window_actor, did_placement);
|
||||
|
||||
if (changes & META_WINDOW_ACTOR_CHANGE_SIZE)
|
||||
meta_plugin_manager_event_size_changed (compositor->plugin_mgr, window_actor);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1325,18 +1327,6 @@ meta_compositor_new (MetaDisplay *display)
|
||||
return compositor;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_get_overlay_window: (skip)
|
||||
* @display: a #MetaDisplay
|
||||
*
|
||||
*/
|
||||
Window
|
||||
meta_get_overlay_window (MetaDisplay *display)
|
||||
{
|
||||
MetaCompositor *compositor = get_compositor_for_display (display);
|
||||
return compositor->output;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_disable_unredirect_for_display:
|
||||
* @display: a #MetaDisplay
|
||||
@@ -1533,7 +1523,7 @@ void
|
||||
meta_compositor_show_window_menu_for_rect (MetaCompositor *compositor,
|
||||
MetaWindow *window,
|
||||
MetaWindowMenuType menu,
|
||||
MetaRectangle *rect)
|
||||
MetaRectangle *rect)
|
||||
{
|
||||
meta_plugin_manager_show_window_menu_for_rect (compositor->plugin_mgr, window, menu, rect);
|
||||
}
|
||||
|
@@ -19,11 +19,6 @@
|
||||
#include "compositor/meta-cullable.h"
|
||||
#include "meta/meta-background-group.h"
|
||||
|
||||
struct _MetaBackgroundGroup
|
||||
{
|
||||
ClutterActor parent;
|
||||
};
|
||||
|
||||
static void cullable_iface_init (MetaCullableInterface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (MetaBackgroundGroup, meta_background_group, CLUTTER_TYPE_ACTOR,
|
||||
|
@@ -252,12 +252,11 @@ static void
|
||||
set_file (MetaBackground *self,
|
||||
GFile **filep,
|
||||
MetaBackgroundImage **imagep,
|
||||
GFile *file)
|
||||
GFile *file,
|
||||
gboolean force_reload)
|
||||
{
|
||||
if (!file_equal0 (*filep, file))
|
||||
if (force_reload || !file_equal0 (*filep, file))
|
||||
{
|
||||
g_clear_object (filep);
|
||||
|
||||
if (*imagep)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (*imagep,
|
||||
@@ -267,11 +266,12 @@ set_file (MetaBackground *self,
|
||||
*imagep = NULL;
|
||||
}
|
||||
|
||||
g_set_object (filep, file);
|
||||
|
||||
if (file)
|
||||
{
|
||||
MetaBackgroundImageCache *cache = meta_background_image_cache_get_default ();
|
||||
|
||||
*filep = g_object_ref (file);
|
||||
*imagep = meta_background_image_cache_load (cache, file);
|
||||
g_signal_connect (*imagep, "loaded",
|
||||
G_CALLBACK (on_background_loaded), self);
|
||||
@@ -279,6 +279,32 @@ set_file (MetaBackground *self,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_gl_video_memory_purged (MetaBackground *self)
|
||||
{
|
||||
MetaBackgroundImageCache *cache = meta_background_image_cache_get_default ();
|
||||
|
||||
/* The GPU memory that just got invalidated is the texture inside
|
||||
* self->background_image1,2 and/or its mipmaps. However, to save memory the
|
||||
* original pixbuf isn't kept in RAM so we can't do a simple re-upload. The
|
||||
* only copy of the image was the one in texture memory that got invalidated.
|
||||
* So we need to do a full reload from disk.
|
||||
*/
|
||||
if (self->file1)
|
||||
{
|
||||
meta_background_image_cache_purge (cache, self->file1);
|
||||
set_file (self, &self->file1, &self->background_image1, self->file1, TRUE);
|
||||
}
|
||||
|
||||
if (self->file2)
|
||||
{
|
||||
meta_background_image_cache_purge (cache, self->file2);
|
||||
set_file (self, &self->file2, &self->background_image2, self->file2, TRUE);
|
||||
}
|
||||
|
||||
mark_changed (self);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_background_dispose (GObject *object)
|
||||
{
|
||||
@@ -287,8 +313,8 @@ meta_background_dispose (GObject *object)
|
||||
free_color_texture (self);
|
||||
free_wallpaper_texture (self);
|
||||
|
||||
set_file (self, &self->file1, &self->background_image1, NULL);
|
||||
set_file (self, &self->file2, &self->background_image2, NULL);
|
||||
set_file (self, &self->file1, &self->background_image1, NULL, FALSE);
|
||||
set_file (self, &self->file2, &self->background_image2, NULL, FALSE);
|
||||
|
||||
set_display (self, NULL);
|
||||
|
||||
@@ -312,7 +338,7 @@ meta_background_constructed (GObject *object)
|
||||
G_OBJECT_CLASS (meta_background_parent_class)->constructed (object);
|
||||
|
||||
g_signal_connect_object (self->display, "gl-video-memory-purged",
|
||||
G_CALLBACK (mark_changed), object, G_CONNECT_SWAPPED);
|
||||
G_CALLBACK (on_gl_video_memory_purged), object, G_CONNECT_SWAPPED);
|
||||
|
||||
g_signal_connect_object (monitor_manager, "monitors-changed",
|
||||
G_CALLBACK (on_monitors_changed), self,
|
||||
@@ -937,8 +963,8 @@ meta_background_set_blend (MetaBackground *self,
|
||||
g_return_if_fail (META_IS_BACKGROUND (self));
|
||||
g_return_if_fail (blend_factor >= 0.0 && blend_factor <= 1.0);
|
||||
|
||||
set_file (self, &self->file1, &self->background_image1, file1);
|
||||
set_file (self, &self->file2, &self->background_image2, file2);
|
||||
set_file (self, &self->file1, &self->background_image1, file1, FALSE);
|
||||
set_file (self, &self->file2, &self->background_image2, file2, FALSE);
|
||||
|
||||
self->blend_factor = blend_factor;
|
||||
self->style = style;
|
||||
|
@@ -26,6 +26,7 @@
|
||||
#include "compositor/compositor-private.h"
|
||||
#include "core/display-private.h"
|
||||
#include "backends/meta-dnd-private.h"
|
||||
#include "backends/x11/meta-backend-x11.h"
|
||||
#include "meta/meta-dnd.h"
|
||||
#include "x11/meta-x11-display-private.h"
|
||||
|
||||
@@ -109,6 +110,35 @@ meta_dnd_init (MetaDnd *dnd)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
meta_dnd_init_xdnd (MetaX11Display *x11_display)
|
||||
{
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
Display *xdisplay = x11_display->xdisplay;
|
||||
Window xwindow, overlay_xwindow;
|
||||
long xdnd_version = 5;
|
||||
|
||||
overlay_xwindow = x11_display->composite_overlay_window;
|
||||
xwindow = meta_backend_x11_get_xwindow (META_BACKEND_X11 (backend));
|
||||
|
||||
XChangeProperty (xdisplay, xwindow,
|
||||
XInternAtom (xdisplay, "XdndAware", TRUE), XA_ATOM,
|
||||
32, PropModeReplace,
|
||||
(const unsigned char *) &xdnd_version, 1);
|
||||
|
||||
XChangeProperty (xdisplay, overlay_xwindow,
|
||||
XInternAtom (xdisplay, "XdndProxy", TRUE), XA_WINDOW,
|
||||
32, PropModeReplace, (const unsigned char *) &xwindow, 1);
|
||||
|
||||
/*
|
||||
* XdndProxy is additionally set on the proxy window as verification that the
|
||||
* XdndProxy property on the target window isn't a left-over
|
||||
*/
|
||||
XChangeProperty (xdisplay, xwindow,
|
||||
XInternAtom (xdisplay, "XdndProxy", TRUE), XA_WINDOW,
|
||||
32, PropModeReplace, (const unsigned char *) &xwindow, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_dnd_notify_dnd_enter (MetaDnd *dnd)
|
||||
{
|
||||
|
@@ -41,9 +41,6 @@ struct _MetaModulePrivate
|
||||
GType plugin_type;
|
||||
};
|
||||
|
||||
#define META_MODULE_GET_PRIVATE(obj) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_MODULE, MetaModulePrivate))
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (MetaModule, meta_module, G_TYPE_TYPE_MODULE);
|
||||
|
||||
static gboolean
|
||||
@@ -192,7 +189,7 @@ meta_module_class_init (MetaModuleClass *klass)
|
||||
static void
|
||||
meta_module_init (MetaModule *self)
|
||||
{
|
||||
self->priv = META_MODULE_GET_PRIVATE (self);
|
||||
self->priv = meta_module_get_instance_private (self);
|
||||
}
|
||||
|
||||
GType
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include "cogl/winsys/cogl-texture-pixmap-x11.h"
|
||||
#include "compositor/meta-cullable.h"
|
||||
#include "compositor/meta-shaped-texture-private.h"
|
||||
#include "compositor/meta-window-actor-private.h"
|
||||
#include "core/window-private.h"
|
||||
#include "meta/meta-x11-errors.h"
|
||||
#include "x11/meta-x11-display-private.h"
|
||||
@@ -71,11 +72,13 @@ static void
|
||||
free_damage (MetaSurfaceActorX11 *self)
|
||||
{
|
||||
MetaDisplay *display = self->display;
|
||||
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
Display *xdisplay;
|
||||
|
||||
if (self->damage == None)
|
||||
return;
|
||||
|
||||
xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
|
||||
meta_x11_error_trap_push (display->x11_display);
|
||||
XDamageDestroy (xdisplay, self->damage);
|
||||
self->damage = None;
|
||||
@@ -86,12 +89,14 @@ static void
|
||||
detach_pixmap (MetaSurfaceActorX11 *self)
|
||||
{
|
||||
MetaDisplay *display = self->display;
|
||||
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
MetaShapedTexture *stex = meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
|
||||
Display *xdisplay;
|
||||
|
||||
if (self->pixmap == None)
|
||||
return;
|
||||
|
||||
xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
|
||||
/* Get rid of all references to the pixmap before freeing it; it's unclear whether
|
||||
* you are supposed to be able to free a GLXPixmap after freeing the underlying
|
||||
* pixmap, but it certainly doesn't work with current DRI/Mesa
|
||||
@@ -343,13 +348,19 @@ meta_surface_actor_x11_is_unredirected (MetaSurfaceActor *actor)
|
||||
return self->unredirected;
|
||||
}
|
||||
|
||||
static void
|
||||
release_x11_resources (MetaSurfaceActorX11 *self)
|
||||
{
|
||||
detach_pixmap (self);
|
||||
free_damage (self);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_surface_actor_x11_dispose (GObject *object)
|
||||
{
|
||||
MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (object);
|
||||
|
||||
detach_pixmap (self);
|
||||
free_damage (self);
|
||||
release_x11_resources (self);
|
||||
|
||||
G_OBJECT_CLASS (meta_surface_actor_x11_parent_class)->dispose (object);
|
||||
}
|
||||
@@ -403,8 +414,7 @@ window_decorated_notify (MetaWindow *window,
|
||||
{
|
||||
MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (user_data);
|
||||
|
||||
detach_pixmap (self);
|
||||
free_damage (self);
|
||||
release_x11_resources (self);
|
||||
create_damage (self);
|
||||
}
|
||||
|
||||
@@ -441,6 +451,10 @@ meta_surface_actor_x11_new (MetaWindow *window)
|
||||
g_signal_connect_object (self->window, "notify::decorated",
|
||||
G_CALLBACK (window_decorated_notify), self, 0);
|
||||
|
||||
g_signal_connect_object (meta_window_actor_from_window (window), "destroy",
|
||||
G_CALLBACK (release_x11_resources), self,
|
||||
G_CONNECT_SWAPPED);
|
||||
|
||||
self->unredirected = FALSE;
|
||||
sync_unredirected (self);
|
||||
|
||||
|
@@ -17,8 +17,8 @@ struct _MetaWindowActorClass
|
||||
ClutterFrameInfo *frame_info,
|
||||
int64_t presentation_time);
|
||||
|
||||
void (*set_surface_actor) (MetaWindowActor *actor,
|
||||
MetaSurfaceActor *surface);
|
||||
void (*assign_surface_actor) (MetaWindowActor *actor,
|
||||
MetaSurfaceActor *surface_actor);
|
||||
|
||||
void (*queue_frame_drawn) (MetaWindowActor *actor,
|
||||
gboolean skip_sync_delay);
|
||||
@@ -28,6 +28,12 @@ struct _MetaWindowActorClass
|
||||
void (*queue_destroy) (MetaWindowActor *actor);
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
META_WINDOW_ACTOR_CHANGE_SIZE = 1 << 0,
|
||||
META_WINDOW_ACTOR_CHANGE_POSITION = 1 << 1
|
||||
} MetaWindowActorChanges;
|
||||
|
||||
void meta_window_actor_queue_destroy (MetaWindowActor *self);
|
||||
|
||||
void meta_window_actor_show (MetaWindowActor *self,
|
||||
@@ -59,8 +65,10 @@ void meta_window_actor_set_unredirected (MetaWindowActor *self,
|
||||
gboolean unredirected);
|
||||
|
||||
gboolean meta_window_actor_effect_in_progress (MetaWindowActor *self);
|
||||
void meta_window_actor_sync_actor_geometry (MetaWindowActor *self,
|
||||
gboolean did_placement);
|
||||
|
||||
MetaWindowActorChanges meta_window_actor_sync_actor_geometry (MetaWindowActor *self,
|
||||
gboolean did_placement);
|
||||
|
||||
void meta_window_actor_update_shape (MetaWindowActor *self);
|
||||
void meta_window_actor_update_opacity (MetaWindowActor *self);
|
||||
void meta_window_actor_mapped (MetaWindowActor *self);
|
||||
@@ -73,7 +81,11 @@ void meta_window_actor_effect_completed (MetaWindowActor *actor,
|
||||
MetaPluginEffect event);
|
||||
|
||||
MetaSurfaceActor *meta_window_actor_get_surface (MetaWindowActor *self);
|
||||
void meta_window_actor_update_surface (MetaWindowActor *self);
|
||||
|
||||
void meta_window_actor_assign_surface_actor (MetaWindowActor *self,
|
||||
MetaSurfaceActor *surface_actor);
|
||||
|
||||
MetaWindowActor *meta_window_actor_from_window (MetaWindow *window);
|
||||
MetaWindowActor *meta_window_actor_from_actor (ClutterActor *actor);
|
||||
|
||||
#endif /* META_WINDOW_ACTOR_PRIVATE_H */
|
||||
|
@@ -38,16 +38,6 @@ meta_window_actor_wayland_frame_complete (MetaWindowActor *actor,
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_actor_wayland_set_surface_actor (MetaWindowActor *actor,
|
||||
MetaSurfaceActor *surface)
|
||||
{
|
||||
MetaWindowActorClass *parent_class =
|
||||
META_WINDOW_ACTOR_CLASS (meta_window_actor_wayland_parent_class);
|
||||
|
||||
parent_class->set_surface_actor (actor, surface);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_actor_wayland_queue_frame_drawn (MetaWindowActor *actor,
|
||||
gboolean skip_sync_delay)
|
||||
@@ -75,7 +65,6 @@ meta_window_actor_wayland_class_init (MetaWindowActorWaylandClass *klass)
|
||||
MetaWindowActorClass *window_actor_class = META_WINDOW_ACTOR_CLASS (klass);
|
||||
|
||||
window_actor_class->frame_complete = meta_window_actor_wayland_frame_complete;
|
||||
window_actor_class->set_surface_actor = meta_window_actor_wayland_set_surface_actor;
|
||||
window_actor_class->queue_frame_drawn = meta_window_actor_wayland_queue_frame_drawn;
|
||||
window_actor_class->pre_paint = meta_window_actor_wayland_pre_paint;
|
||||
window_actor_class->post_paint = meta_window_actor_wayland_post_paint;
|
||||
|
@@ -20,10 +20,13 @@
|
||||
* Georges Basile Stavracas Neto <gbsneto@gnome.org>
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "compositor/meta-window-actor-x11.h"
|
||||
|
||||
#include "backends/meta-logical-monitor.h"
|
||||
#include "compositor/compositor-private.h"
|
||||
#include "compositor/meta-surface-actor.h"
|
||||
#include "compositor/meta-window-actor-x11.h"
|
||||
#include "core/window-private.h"
|
||||
#include "meta/compositor.h"
|
||||
#include "meta/meta-window-actor.h"
|
||||
@@ -326,32 +329,19 @@ meta_window_actor_x11_frame_complete (MetaWindowActor *actor,
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_actor_x11_set_surface_actor (MetaWindowActor *actor,
|
||||
MetaSurfaceActor *surface)
|
||||
meta_window_actor_x11_assign_surface_actor (MetaWindowActor *actor,
|
||||
MetaSurfaceActor *surface_actor)
|
||||
{
|
||||
MetaWindowActorClass *parent_class =
|
||||
META_WINDOW_ACTOR_CLASS (meta_window_actor_x11_parent_class);
|
||||
MetaWindowActorX11 *actor_x11 = META_WINDOW_ACTOR_X11 (actor);
|
||||
MetaSurfaceActor *old_surface;
|
||||
|
||||
old_surface = meta_window_actor_get_surface (actor);
|
||||
parent_class->assign_surface_actor (actor, surface_actor);
|
||||
|
||||
if (old_surface)
|
||||
{
|
||||
g_signal_handler_disconnect (old_surface,
|
||||
actor_x11->repaint_scheduled_id);
|
||||
actor_x11->repaint_scheduled_id = 0;
|
||||
}
|
||||
|
||||
parent_class->set_surface_actor (actor, surface);
|
||||
|
||||
if (surface)
|
||||
{
|
||||
actor_x11->repaint_scheduled_id =
|
||||
g_signal_connect (surface, "repaint-scheduled",
|
||||
G_CALLBACK (surface_repaint_scheduled),
|
||||
actor_x11);
|
||||
}
|
||||
actor_x11->repaint_scheduled_id =
|
||||
g_signal_connect (surface_actor, "repaint-scheduled",
|
||||
G_CALLBACK (surface_repaint_scheduled),
|
||||
actor_x11);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -500,10 +490,19 @@ static void
|
||||
meta_window_actor_x11_dispose (GObject *object)
|
||||
{
|
||||
MetaWindowActorX11 *actor_x11 = META_WINDOW_ACTOR_X11 (object);
|
||||
MetaSurfaceActor *surface_actor;
|
||||
|
||||
if (actor_x11->send_frame_messages_timer != 0)
|
||||
remove_frame_messages_timer (actor_x11);
|
||||
|
||||
surface_actor = meta_window_actor_get_surface (META_WINDOW_ACTOR (actor_x11));
|
||||
if (surface_actor)
|
||||
{
|
||||
g_signal_handler_disconnect (surface_actor,
|
||||
actor_x11->repaint_scheduled_id);
|
||||
actor_x11->repaint_scheduled_id = 0;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (meta_window_actor_x11_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
@@ -525,7 +524,7 @@ meta_window_actor_x11_class_init (MetaWindowActorX11Class *klass)
|
||||
MetaWindowActorClass *window_actor_class = META_WINDOW_ACTOR_CLASS (klass);
|
||||
|
||||
window_actor_class->frame_complete = meta_window_actor_x11_frame_complete;
|
||||
window_actor_class->set_surface_actor = meta_window_actor_x11_set_surface_actor;
|
||||
window_actor_class->assign_surface_actor = meta_window_actor_x11_assign_surface_actor;
|
||||
window_actor_class->queue_frame_drawn = meta_window_actor_x11_queue_frame_drawn;
|
||||
window_actor_class->pre_paint = meta_window_actor_x11_pre_paint;
|
||||
window_actor_class->post_paint = meta_window_actor_x11_post_paint;
|
||||
|
@@ -51,8 +51,6 @@ typedef enum
|
||||
|
||||
typedef struct _MetaWindowActorPrivate
|
||||
{
|
||||
ClutterActor parent;
|
||||
|
||||
MetaWindow *window;
|
||||
MetaCompositor *compositor;
|
||||
|
||||
@@ -139,12 +137,13 @@ static void meta_window_actor_get_property (GObject *object,
|
||||
GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
static void meta_window_actor_real_assign_surface_actor (MetaWindowActor *self,
|
||||
MetaSurfaceActor *surface_actor);
|
||||
|
||||
static void meta_window_actor_paint (ClutterActor *actor);
|
||||
|
||||
static gboolean meta_window_actor_get_paint_volume (ClutterActor *actor,
|
||||
ClutterPaintVolume *volume);
|
||||
static void set_surface (MetaWindowActor *actor,
|
||||
MetaSurfaceActor *surface);
|
||||
|
||||
static gboolean meta_window_actor_has_shadow (MetaWindowActor *self);
|
||||
|
||||
@@ -161,13 +160,6 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (MetaWindowActor, meta_window_actor, CLUTTER_TY
|
||||
G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE, cullable_iface_init)
|
||||
G_IMPLEMENT_INTERFACE (META_TYPE_SCREEN_CAST_WINDOW, screen_cast_window_iface_init));
|
||||
|
||||
static void
|
||||
meta_window_actor_real_set_surface_actor (MetaWindowActor *actor,
|
||||
MetaSurfaceActor *surface)
|
||||
{
|
||||
set_surface (actor, surface);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_window_actor_class_init (MetaWindowActorClass *klass)
|
||||
{
|
||||
@@ -183,7 +175,7 @@ meta_window_actor_class_init (MetaWindowActorClass *klass)
|
||||
actor_class->paint = meta_window_actor_paint;
|
||||
actor_class->get_paint_volume = meta_window_actor_get_paint_volume;
|
||||
|
||||
klass->set_surface_actor = meta_window_actor_real_set_surface_actor;
|
||||
klass->assign_surface_actor = meta_window_actor_real_assign_surface_actor;
|
||||
|
||||
/**
|
||||
* MetaWindowActor::first-frame:
|
||||
@@ -367,56 +359,55 @@ meta_window_actor_thaw (MetaWindowActor *self)
|
||||
}
|
||||
|
||||
static void
|
||||
set_surface (MetaWindowActor *self,
|
||||
MetaSurfaceActor *surface)
|
||||
meta_window_actor_real_assign_surface_actor (MetaWindowActor *self,
|
||||
MetaSurfaceActor *surface_actor)
|
||||
{
|
||||
MetaWindowActorPrivate *priv =
|
||||
meta_window_actor_get_instance_private (self);
|
||||
|
||||
if (priv->surface)
|
||||
{
|
||||
g_signal_handler_disconnect (priv->surface, priv->size_changed_id);
|
||||
clutter_actor_remove_child (CLUTTER_ACTOR (self), CLUTTER_ACTOR (priv->surface));
|
||||
g_object_unref (priv->surface);
|
||||
}
|
||||
g_assert (!priv->surface);
|
||||
|
||||
priv->surface = surface;
|
||||
priv->surface = g_object_ref_sink (surface_actor);
|
||||
priv->size_changed_id = g_signal_connect (priv->surface, "size-changed",
|
||||
G_CALLBACK (surface_size_changed),
|
||||
self);
|
||||
clutter_actor_add_child (CLUTTER_ACTOR (self), CLUTTER_ACTOR (priv->surface));
|
||||
|
||||
if (priv->surface)
|
||||
{
|
||||
g_object_ref_sink (priv->surface);
|
||||
priv->size_changed_id = g_signal_connect (priv->surface, "size-changed",
|
||||
G_CALLBACK (surface_size_changed), self);
|
||||
clutter_actor_add_child (CLUTTER_ACTOR (self), CLUTTER_ACTOR (priv->surface));
|
||||
meta_window_actor_update_shape (self);
|
||||
|
||||
meta_window_actor_update_shape (self);
|
||||
|
||||
if (is_frozen (self))
|
||||
meta_surface_actor_set_frozen (priv->surface, TRUE);
|
||||
else
|
||||
meta_window_actor_sync_thawed_state (self);
|
||||
}
|
||||
if (is_frozen (self))
|
||||
meta_surface_actor_set_frozen (priv->surface, TRUE);
|
||||
else
|
||||
meta_window_actor_sync_thawed_state (self);
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_actor_update_surface (MetaWindowActor *self)
|
||||
meta_window_actor_assign_surface_actor (MetaWindowActor *self,
|
||||
MetaSurfaceActor *surface_actor)
|
||||
{
|
||||
META_WINDOW_ACTOR_GET_CLASS (self)->assign_surface_actor (self,
|
||||
surface_actor);
|
||||
}
|
||||
|
||||
static void
|
||||
init_surface_actor (MetaWindowActor *self)
|
||||
{
|
||||
MetaWindowActorPrivate *priv =
|
||||
meta_window_actor_get_instance_private (self);
|
||||
MetaWindow *window = priv->window;
|
||||
MetaSurfaceActor *surface_actor;
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
if (window->surface)
|
||||
surface_actor = meta_wayland_surface_get_actor (window->surface);
|
||||
else
|
||||
#endif
|
||||
if (!meta_is_wayland_compositor ())
|
||||
surface_actor = meta_surface_actor_x11_new (window);
|
||||
#ifdef HAVE_WAYLAND
|
||||
else if (window->surface)
|
||||
surface_actor = meta_wayland_surface_get_actor (window->surface);
|
||||
#endif
|
||||
else
|
||||
surface_actor = NULL;
|
||||
|
||||
set_surface (self, surface_actor);
|
||||
if (surface_actor)
|
||||
meta_window_actor_assign_surface_actor (self, surface_actor);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -429,7 +420,10 @@ meta_window_actor_constructed (GObject *object)
|
||||
|
||||
priv->compositor = window->display->compositor;
|
||||
|
||||
meta_window_actor_update_surface (self);
|
||||
/* Hang our compositor window state off the MetaWindow for fast retrieval */
|
||||
meta_window_set_compositor_private (window, object);
|
||||
|
||||
init_surface_actor (self);
|
||||
|
||||
meta_window_actor_update_opacity (self);
|
||||
|
||||
@@ -445,9 +439,6 @@ meta_window_actor_constructed (GObject *object)
|
||||
priv->first_frame_state = DRAWING_FIRST_FRAME;
|
||||
|
||||
meta_window_actor_sync_actor_geometry (self, priv->window->placed);
|
||||
|
||||
/* Hang our compositor window state off the MetaWindow for fast retrieval */
|
||||
meta_window_set_compositor_private (window, object);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -459,7 +450,10 @@ meta_window_actor_dispose (GObject *object)
|
||||
MetaCompositor *compositor = priv->compositor;
|
||||
|
||||
if (priv->disposed)
|
||||
return;
|
||||
{
|
||||
G_OBJECT_CLASS (meta_window_actor_parent_class)->dispose (object);
|
||||
return;
|
||||
}
|
||||
|
||||
priv->disposed = TRUE;
|
||||
|
||||
@@ -475,7 +469,13 @@ meta_window_actor_dispose (GObject *object)
|
||||
|
||||
g_clear_object (&priv->window);
|
||||
|
||||
set_surface (self, NULL);
|
||||
if (priv->surface)
|
||||
{
|
||||
g_signal_handler_disconnect (priv->surface, priv->size_changed_id);
|
||||
clutter_actor_remove_child (CLUTTER_ACTOR (self),
|
||||
CLUTTER_ACTOR (priv->surface));
|
||||
g_clear_object (&priv->surface);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (meta_window_actor_parent_class)->dispose (object);
|
||||
}
|
||||
@@ -1120,13 +1120,15 @@ meta_window_actor_queue_destroy (MetaWindowActor *self)
|
||||
clutter_actor_destroy (CLUTTER_ACTOR (self));
|
||||
}
|
||||
|
||||
void
|
||||
MetaWindowActorChanges
|
||||
meta_window_actor_sync_actor_geometry (MetaWindowActor *self,
|
||||
gboolean did_placement)
|
||||
{
|
||||
MetaWindowActorPrivate *priv =
|
||||
meta_window_actor_get_instance_private (self);
|
||||
MetaRectangle window_rect;
|
||||
ClutterActor *actor = CLUTTER_ACTOR (self);
|
||||
MetaWindowActorChanges changes = 0;
|
||||
|
||||
meta_window_get_buffer_rect (priv->window, &window_rect);
|
||||
|
||||
@@ -1144,15 +1146,42 @@ meta_window_actor_sync_actor_geometry (MetaWindowActor *self,
|
||||
* updates.
|
||||
*/
|
||||
if (is_frozen (self) && !did_placement)
|
||||
return;
|
||||
return META_WINDOW_ACTOR_CHANGE_POSITION | META_WINDOW_ACTOR_CHANGE_SIZE;
|
||||
|
||||
if (meta_window_actor_effect_in_progress (self))
|
||||
return;
|
||||
return META_WINDOW_ACTOR_CHANGE_POSITION | META_WINDOW_ACTOR_CHANGE_SIZE;
|
||||
|
||||
clutter_actor_set_position (CLUTTER_ACTOR (self),
|
||||
window_rect.x, window_rect.y);
|
||||
clutter_actor_set_size (CLUTTER_ACTOR (self),
|
||||
window_rect.width, window_rect.height);
|
||||
if (clutter_actor_has_allocation (actor))
|
||||
{
|
||||
ClutterActorBox box;
|
||||
float old_x, old_y;
|
||||
float old_width, old_height;
|
||||
|
||||
clutter_actor_get_allocation_box (actor, &box);
|
||||
|
||||
old_x = box.x1;
|
||||
old_y = box.y1;
|
||||
old_width = box.x2 - box.x1;
|
||||
old_height = box.y2 - box.y1;
|
||||
|
||||
if (old_x != window_rect.x || old_y != window_rect.y)
|
||||
changes |= META_WINDOW_ACTOR_CHANGE_POSITION;
|
||||
|
||||
if (old_width != window_rect.width || old_height != window_rect.height)
|
||||
changes |= META_WINDOW_ACTOR_CHANGE_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
changes = META_WINDOW_ACTOR_CHANGE_POSITION | META_WINDOW_ACTOR_CHANGE_SIZE;
|
||||
}
|
||||
|
||||
if (changes & META_WINDOW_ACTOR_CHANGE_POSITION)
|
||||
clutter_actor_set_position (actor, window_rect.x, window_rect.y);
|
||||
|
||||
if (changes & META_WINDOW_ACTOR_CHANGE_SIZE)
|
||||
clutter_actor_set_size (actor, window_rect.width, window_rect.height);
|
||||
|
||||
return changes;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -2006,3 +2035,21 @@ screen_cast_window_iface_init (MetaScreenCastWindowInterface *iface)
|
||||
iface->capture_into = meta_window_actor_capture_into;
|
||||
iface->has_damage = meta_window_actor_has_damage;
|
||||
}
|
||||
|
||||
MetaWindowActor *
|
||||
meta_window_actor_from_actor (ClutterActor *actor)
|
||||
{
|
||||
if (!META_IS_SURFACE_ACTOR (actor))
|
||||
return NULL;
|
||||
|
||||
do
|
||||
{
|
||||
actor = clutter_actor_get_parent (actor);
|
||||
|
||||
if (META_IS_WINDOW_ACTOR (actor))
|
||||
return META_WINDOW_ACTOR (actor);
|
||||
}
|
||||
while (actor != NULL);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -50,9 +50,6 @@
|
||||
#define META_IS_DEFAULT_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_DEFAULT_PLUGIN))
|
||||
#define META_DEFAULT_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_DEFAULT_PLUGIN, MetaDefaultPluginClass))
|
||||
|
||||
#define META_DEFAULT_PLUGIN_GET_PRIVATE(obj) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_DEFAULT_PLUGIN, MetaDefaultPluginPrivate))
|
||||
|
||||
typedef struct _MetaDefaultPlugin MetaDefaultPlugin;
|
||||
typedef struct _MetaDefaultPluginClass MetaDefaultPluginClass;
|
||||
typedef struct _MetaDefaultPluginPrivate MetaDefaultPluginPrivate;
|
||||
@@ -218,7 +215,7 @@ meta_default_plugin_init (MetaDefaultPlugin *self)
|
||||
{
|
||||
MetaDefaultPluginPrivate *priv;
|
||||
|
||||
self->priv = priv = META_DEFAULT_PLUGIN_GET_PRIVATE (self);
|
||||
self->priv = priv = meta_default_plugin_get_instance_private (self);
|
||||
|
||||
priv->info.name = "Default Effects";
|
||||
priv->info.version = "0.1";
|
||||
|
@@ -257,7 +257,7 @@ meta_display_class_init (MetaDisplayClass *klass)
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
|
||||
G_TYPE_NONE, 3, G_TYPE_UINT, CLUTTER_TYPE_INPUT_DEVICE, G_TYPE_UINT);
|
||||
|
||||
/**
|
||||
* MetaDisplay::modifiers-accelerator-activated:
|
||||
@@ -2621,9 +2621,9 @@ meta_display_accelerator_activate (MetaDisplay *display,
|
||||
guint action,
|
||||
ClutterKeyEvent *event)
|
||||
{
|
||||
g_signal_emit (display, display_signals[ACCELERATOR_ACTIVATED],
|
||||
0, action,
|
||||
clutter_input_device_get_device_id (event->device),
|
||||
g_signal_emit (display, display_signals[ACCELERATOR_ACTIVATED], 0,
|
||||
action,
|
||||
clutter_event_get_source_device ((ClutterEvent *) event),
|
||||
event->time);
|
||||
}
|
||||
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#include "backends/meta-cursor-tracker-private.h"
|
||||
#include "backends/meta-idle-monitor-private.h"
|
||||
#include "backends/x11/meta-backend-x11.h"
|
||||
#include "compositor/meta-surface-actor.h"
|
||||
#include "compositor/meta-window-actor-private.h"
|
||||
#include "core/display-private.h"
|
||||
#include "core/window-private.h"
|
||||
#include "meta/meta-backend.h"
|
||||
@@ -68,14 +68,16 @@ get_window_for_event (MetaDisplay *display,
|
||||
case META_EVENT_ROUTE_NORMAL:
|
||||
{
|
||||
ClutterActor *source;
|
||||
MetaWindowActor *window_actor;
|
||||
|
||||
/* Always use the key focused window for key events. */
|
||||
if (IS_KEY_EVENT (event))
|
||||
return stage_has_key_focus () ? display->focus_window : NULL;
|
||||
|
||||
source = clutter_event_get_source (event);
|
||||
if (META_IS_SURFACE_ACTOR (source))
|
||||
return meta_surface_actor_get_window (META_SURFACE_ACTOR (source));
|
||||
window_actor = meta_window_actor_from_actor (source);
|
||||
if (window_actor)
|
||||
return meta_window_actor_get_meta_window (window_actor);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -154,6 +154,7 @@ GList *meta_prefs_get_keybindings (void);
|
||||
void meta_prefs_get_overlay_binding (MetaKeyCombo *combo);
|
||||
void meta_prefs_get_locate_pointer_binding (MetaKeyCombo *combo);
|
||||
const char *meta_prefs_get_iso_next_group_option (void);
|
||||
gboolean meta_prefs_is_locate_pointer_enabled (void);
|
||||
|
||||
void meta_x11_display_grab_keys (MetaX11Display *x11_display);
|
||||
void meta_x11_display_ungrab_keys (MetaX11Display *x11_display);
|
||||
|
@@ -182,8 +182,8 @@ static gboolean process_keyboard_resize_grab (MetaDisplay *display,
|
||||
MetaWindow *window,
|
||||
ClutterKeyEvent *event);
|
||||
|
||||
static void grab_key_bindings (MetaDisplay *display);
|
||||
static void ungrab_key_bindings (MetaDisplay *display);
|
||||
static void maybe_update_locate_pointer_keygrab (MetaDisplay *display,
|
||||
gboolean grab);
|
||||
|
||||
static GHashTable *key_handlers;
|
||||
static GHashTable *external_grabs;
|
||||
@@ -529,8 +529,8 @@ reload_iso_next_group_combos (MetaKeyBindingManager *keys)
|
||||
|
||||
static void
|
||||
devirtualize_modifiers (MetaKeyBindingManager *keys,
|
||||
MetaVirtualModifier modifiers,
|
||||
unsigned int *mask)
|
||||
MetaVirtualModifier modifiers,
|
||||
unsigned int *mask)
|
||||
{
|
||||
*mask = 0;
|
||||
|
||||
@@ -1345,6 +1345,10 @@ prefs_changed_callback (MetaPreference pref,
|
||||
|
||||
switch (pref)
|
||||
{
|
||||
case META_PREF_LOCATE_POINTER:
|
||||
maybe_update_locate_pointer_keygrab (display,
|
||||
meta_prefs_is_locate_pointer_enabled());
|
||||
break;
|
||||
case META_PREF_KEYBINDINGS:
|
||||
ungrab_key_bindings (display);
|
||||
rebuild_key_binding_table (keys);
|
||||
@@ -1466,6 +1470,12 @@ change_keygrab_foreach (gpointer key,
|
||||
if (data->only_per_window != binding_is_per_window)
|
||||
return;
|
||||
|
||||
/* Ignore the key bindings marked as META_KEY_BINDING_NO_AUTO_GRAB,
|
||||
* those are handled separately
|
||||
*/
|
||||
if (binding->flags & META_KEY_BINDING_NO_AUTO_GRAB)
|
||||
return;
|
||||
|
||||
if (binding->resolved_combo.len == 0)
|
||||
return;
|
||||
|
||||
@@ -1474,9 +1484,9 @@ change_keygrab_foreach (gpointer key,
|
||||
|
||||
static void
|
||||
change_binding_keygrabs (MetaKeyBindingManager *keys,
|
||||
Window xwindow,
|
||||
gboolean only_per_window,
|
||||
gboolean grab)
|
||||
Window xwindow,
|
||||
gboolean only_per_window,
|
||||
gboolean grab)
|
||||
{
|
||||
ChangeKeygrabData data;
|
||||
|
||||
@@ -1488,6 +1498,21 @@ change_binding_keygrabs (MetaKeyBindingManager *keys,
|
||||
g_hash_table_foreach (keys->key_bindings, change_keygrab_foreach, &data);
|
||||
}
|
||||
|
||||
static void
|
||||
maybe_update_locate_pointer_keygrab (MetaDisplay *display,
|
||||
gboolean grab)
|
||||
{
|
||||
MetaKeyBindingManager *keys = &display->key_binding_manager;
|
||||
|
||||
if (!display->x11_display)
|
||||
return;
|
||||
|
||||
if (keys->locate_pointer_resolved_key_combo.len != 0)
|
||||
meta_change_keygrab (keys, display->x11_display->xroot,
|
||||
(!!grab & !!meta_prefs_is_locate_pointer_enabled()),
|
||||
&keys->locate_pointer_resolved_key_combo);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_x11_display_change_keygrabs (MetaX11Display *x11_display,
|
||||
gboolean grab)
|
||||
@@ -1499,9 +1524,7 @@ meta_x11_display_change_keygrabs (MetaX11Display *x11_display,
|
||||
meta_change_keygrab (keys, x11_display->xroot,
|
||||
grab, &keys->overlay_resolved_key_combo);
|
||||
|
||||
if (keys->locate_pointer_resolved_key_combo.len != 0)
|
||||
meta_change_keygrab (keys, x11_display->xroot,
|
||||
grab, &keys->locate_pointer_resolved_key_combo);
|
||||
maybe_update_locate_pointer_keygrab (x11_display->display, grab);
|
||||
|
||||
for (i = 0; i < keys->n_iso_next_group_combos; i++)
|
||||
meta_change_keygrab (keys, x11_display->xroot,
|
||||
@@ -4453,13 +4476,13 @@ meta_display_init_keys (MetaDisplay *display)
|
||||
|
||||
handler = g_new0 (MetaKeyHandler, 1);
|
||||
handler->name = g_strdup ("overlay-key");
|
||||
handler->flags = META_KEY_BINDING_BUILTIN;
|
||||
handler->flags = META_KEY_BINDING_BUILTIN | META_KEY_BINDING_NO_AUTO_GRAB;
|
||||
|
||||
g_hash_table_insert (key_handlers, g_strdup (handler->name), handler);
|
||||
|
||||
handler = g_new0 (MetaKeyHandler, 1);
|
||||
handler->name = g_strdup ("locate-pointer-key");
|
||||
handler->flags = META_KEY_BINDING_BUILTIN;
|
||||
handler->flags = META_KEY_BINDING_BUILTIN | META_KEY_BINDING_NO_AUTO_GRAB;
|
||||
|
||||
g_hash_table_insert (key_handlers, g_strdup (handler->name), handler);
|
||||
|
||||
|
@@ -41,6 +41,7 @@ enum
|
||||
WORKSPACE_ADDED,
|
||||
WORKSPACE_REMOVED,
|
||||
WORKSPACE_SWITCHED,
|
||||
WORKSPACES_REORDERED,
|
||||
ACTIVE_WORKSPACE_CHANGED,
|
||||
SHOWING_DESKTOP_CHANGED,
|
||||
LAST_SIGNAL
|
||||
@@ -50,6 +51,9 @@ enum
|
||||
{
|
||||
PROP_0,
|
||||
|
||||
PROP_LAYOUT_COLUMNS,
|
||||
PROP_LAYOUT_ROWS,
|
||||
|
||||
PROP_N_WORKSPACES
|
||||
};
|
||||
|
||||
@@ -68,6 +72,12 @@ meta_workspace_manager_get_property (GObject *object,
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_LAYOUT_COLUMNS:
|
||||
g_value_set_int (value, workspace_manager->columns_of_workspaces);
|
||||
break;
|
||||
case PROP_LAYOUT_ROWS:
|
||||
g_value_set_int (value, workspace_manager->rows_of_workspaces);
|
||||
break;
|
||||
case PROP_N_WORKSPACES:
|
||||
g_value_set_int (value, meta_workspace_manager_get_n_workspaces (workspace_manager));
|
||||
break;
|
||||
@@ -140,6 +150,20 @@ meta_workspace_manager_class_init (MetaWorkspaceManagerClass *klass)
|
||||
G_TYPE_INT,
|
||||
META_TYPE_MOTION_DIRECTION);
|
||||
|
||||
/* Emitted when calling meta_workspace_manager_reorder_workspace.
|
||||
*
|
||||
* This signal is emitted when a workspace has been reordered to
|
||||
* a different index. Note that other workspaces can change
|
||||
* their index too when reordering happens.
|
||||
*/
|
||||
workspace_manager_signals[WORKSPACES_REORDERED] =
|
||||
g_signal_new ("workspaces-reordered",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
workspace_manager_signals[ACTIVE_WORKSPACE_CHANGED] =
|
||||
g_signal_new ("active-workspace-changed",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
@@ -154,6 +178,22 @@ meta_workspace_manager_class_init (MetaWorkspaceManagerClass *klass)
|
||||
0, NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_LAYOUT_COLUMNS,
|
||||
g_param_spec_int ("layout-columns",
|
||||
"Layout columns",
|
||||
"Number of columns in layout",
|
||||
-1, G_MAXINT, 1,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_LAYOUT_ROWS,
|
||||
g_param_spec_int ("layout-rows",
|
||||
"Layout rows",
|
||||
"Number of rows in layout",
|
||||
-1, G_MAXINT, -1,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_N_WORKSPACES,
|
||||
g_param_spec_int ("n-workspaces",
|
||||
@@ -450,6 +490,74 @@ meta_workspace_manager_update_num_workspaces (MetaWorkspaceManager *workspace_ma
|
||||
g_object_notify (G_OBJECT (workspace_manager), "n-workspaces");
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_workspace_manager_reorder_workspace:
|
||||
* @workspace_manager: a #MetaWorkspaceManager
|
||||
* @workspace: a #MetaWorkspace to reorder
|
||||
* @new_index: the new index of the passed workspace
|
||||
*
|
||||
* Reorder a workspace to a new index. If the workspace is currently active
|
||||
* the "active-workspace-changed" signal will be emited.
|
||||
* If the workspace's index is the same as @new_index or the workspace
|
||||
* will not be found in the list, this function will return.
|
||||
*
|
||||
* Calling this function will also emit the "workspaces-reordered" signal.
|
||||
*/
|
||||
void
|
||||
meta_workspace_manager_reorder_workspace (MetaWorkspaceManager *workspace_manager,
|
||||
MetaWorkspace *workspace,
|
||||
int new_index)
|
||||
{
|
||||
GList *l;
|
||||
GList *from, *to;
|
||||
int index;
|
||||
int active_index, new_active_index;
|
||||
|
||||
g_return_if_fail (META_IS_WORKSPACE_MANAGER (workspace_manager));
|
||||
g_return_if_fail (new_index >= 0 &&
|
||||
new_index < g_list_length (workspace_manager->workspaces));
|
||||
|
||||
l = g_list_find (workspace_manager->workspaces, workspace);
|
||||
g_return_if_fail (l);
|
||||
|
||||
index = meta_workspace_index (workspace);
|
||||
|
||||
if (new_index == index)
|
||||
return;
|
||||
|
||||
active_index =
|
||||
meta_workspace_manager_get_active_workspace_index (workspace_manager);
|
||||
|
||||
workspace_manager->workspaces =
|
||||
g_list_remove_link (workspace_manager->workspaces, l);
|
||||
|
||||
workspace_manager->workspaces =
|
||||
g_list_insert (workspace_manager->workspaces, l->data, new_index);
|
||||
|
||||
g_list_free (l);
|
||||
|
||||
new_active_index =
|
||||
meta_workspace_manager_get_active_workspace_index (workspace_manager);
|
||||
|
||||
if (active_index != new_active_index)
|
||||
g_signal_emit (workspace_manager,
|
||||
workspace_manager_signals[ACTIVE_WORKSPACE_CHANGED],
|
||||
0, NULL);
|
||||
|
||||
from = g_list_nth (workspace_manager->workspaces, MIN (new_index, index));
|
||||
to = g_list_nth (workspace_manager->workspaces, MAX (new_index, index));
|
||||
for (l = from; l != to->next; l = l->next)
|
||||
{
|
||||
MetaWorkspace *w = l->data;
|
||||
|
||||
meta_workspace_index_changed (w);
|
||||
}
|
||||
|
||||
meta_display_queue_workarea_recalc (workspace_manager->display);
|
||||
g_signal_emit (workspace_manager,
|
||||
workspace_manager_signals[WORKSPACES_REORDERED], 0, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
meta_workspace_manager_update_workspace_layout (MetaWorkspaceManager *workspace_manager,
|
||||
MetaDisplayCorner starting_corner,
|
||||
@@ -474,6 +582,8 @@ meta_workspace_manager_update_workspace_layout (MetaWorkspaceManager *workspace_
|
||||
workspace_manager->columns_of_workspaces,
|
||||
workspace_manager->vertical_workspaces,
|
||||
workspace_manager->starting_corner);
|
||||
g_object_notify (G_OBJECT (workspace_manager), "layout-columns");
|
||||
g_object_notify (G_OBJECT (workspace_manager), "layout-rows");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -60,6 +60,7 @@
|
||||
|
||||
#define KEY_OVERLAY_KEY "overlay-key"
|
||||
#define KEY_WORKSPACES_ONLY_ON_PRIMARY "workspaces-only-on-primary"
|
||||
#define KEY_LOCATE_POINTER "locate-pointer"
|
||||
|
||||
/* These are the different schemas we are keeping
|
||||
* a GSettings instance for */
|
||||
@@ -100,6 +101,7 @@ static gboolean bell_is_visible = FALSE;
|
||||
static gboolean bell_is_audible = TRUE;
|
||||
static gboolean gnome_accessibility = FALSE;
|
||||
static gboolean gnome_animations = TRUE;
|
||||
static gboolean locate_pointer_is_enabled = FALSE;
|
||||
static char *cursor_theme = NULL;
|
||||
/* cursor_size will, when running as an X11 compositing window manager, be the
|
||||
* actual cursor size, multiplied with the global window scaling factor. On
|
||||
@@ -147,6 +149,7 @@ static gboolean mouse_button_mods_handler (GVariant*, gpointer*, gpointer);
|
||||
static gboolean button_layout_handler (GVariant*, gpointer*, gpointer);
|
||||
static gboolean overlay_key_handler (GVariant*, gpointer*, gpointer);
|
||||
static gboolean locate_pointer_key_handler (GVariant*, gpointer*, gpointer);
|
||||
|
||||
static gboolean iso_next_group_handler (GVariant*, gpointer*, gpointer);
|
||||
|
||||
static void init_bindings (void);
|
||||
@@ -384,6 +387,13 @@ static MetaBoolPreference preferences_bool[] =
|
||||
},
|
||||
&auto_maximize,
|
||||
},
|
||||
{
|
||||
{ KEY_LOCATE_POINTER,
|
||||
SCHEMA_INTERFACE,
|
||||
META_PREF_LOCATE_POINTER,
|
||||
},
|
||||
&locate_pointer_is_enabled,
|
||||
},
|
||||
{ { NULL, 0, 0 }, NULL },
|
||||
};
|
||||
|
||||
@@ -960,6 +970,8 @@ meta_prefs_init (void)
|
||||
G_CALLBACK (settings_changed), NULL);
|
||||
g_signal_connect (settings, "changed::" KEY_GNOME_CURSOR_SIZE,
|
||||
G_CALLBACK (settings_changed), NULL);
|
||||
g_signal_connect (settings, "changed::" KEY_LOCATE_POINTER,
|
||||
G_CALLBACK (settings_changed), NULL);
|
||||
g_hash_table_insert (settings_schemas, g_strdup (SCHEMA_INTERFACE), settings);
|
||||
|
||||
settings = g_settings_new (SCHEMA_INPUT_SOURCES);
|
||||
@@ -1680,6 +1692,9 @@ meta_preference_to_string (MetaPreference pref)
|
||||
|
||||
case META_PREF_AUTO_MAXIMIZE:
|
||||
return "AUTO_MAXIMIZE";
|
||||
|
||||
case META_PREF_LOCATE_POINTER:
|
||||
return "LOCATE_POINTER";
|
||||
}
|
||||
|
||||
return "(unknown)";
|
||||
@@ -2020,6 +2035,12 @@ meta_prefs_get_locate_pointer_binding (MetaKeyCombo *combo)
|
||||
*combo = locate_pointer_key_combo;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_prefs_is_locate_pointer_enabled (void)
|
||||
{
|
||||
return locate_pointer_is_enabled;
|
||||
}
|
||||
|
||||
const char *
|
||||
meta_prefs_get_iso_next_group_option (void)
|
||||
{
|
||||
|
@@ -49,10 +49,9 @@
|
||||
|
||||
static void meta_window_set_stack_position_no_sync (MetaWindow *window,
|
||||
int position);
|
||||
static void stack_do_relayer (MetaStack *stack);
|
||||
static void stack_do_constrain (MetaStack *stack);
|
||||
static void stack_do_resort (MetaStack *stack);
|
||||
|
||||
static void stack_do_relayer (MetaStack *stack);
|
||||
static void stack_do_constrain (MetaStack *stack);
|
||||
static void stack_do_resort (MetaStack *stack);
|
||||
static void stack_ensure_sorted (MetaStack *stack);
|
||||
|
||||
enum
|
||||
@@ -969,7 +968,7 @@ stack_ensure_sorted (MetaStack *stack)
|
||||
stack_do_resort (stack);
|
||||
}
|
||||
|
||||
MetaWindow*
|
||||
MetaWindow *
|
||||
meta_stack_get_top (MetaStack *stack)
|
||||
{
|
||||
stack_ensure_sorted (stack);
|
||||
@@ -980,7 +979,7 @@ meta_stack_get_top (MetaStack *stack)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MetaWindow*
|
||||
MetaWindow *
|
||||
meta_stack_get_bottom (MetaStack *stack)
|
||||
{
|
||||
GList *link;
|
||||
@@ -994,10 +993,10 @@ meta_stack_get_bottom (MetaStack *stack)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MetaWindow*
|
||||
meta_stack_get_above (MetaStack *stack,
|
||||
MetaWindow *window,
|
||||
gboolean only_within_layer)
|
||||
MetaWindow *
|
||||
meta_stack_get_above (MetaStack *stack,
|
||||
MetaWindow *window,
|
||||
gboolean only_within_layer)
|
||||
{
|
||||
GList *link;
|
||||
MetaWindow *above;
|
||||
@@ -1019,10 +1018,10 @@ meta_stack_get_above (MetaStack *stack,
|
||||
return above;
|
||||
}
|
||||
|
||||
MetaWindow*
|
||||
meta_stack_get_below (MetaStack *stack,
|
||||
MetaWindow *window,
|
||||
gboolean only_within_layer)
|
||||
MetaWindow *
|
||||
meta_stack_get_below (MetaStack *stack,
|
||||
MetaWindow *window,
|
||||
gboolean only_within_layer)
|
||||
{
|
||||
GList *link;
|
||||
MetaWindow *below;
|
||||
@@ -1057,7 +1056,28 @@ window_contains_point (MetaWindow *window,
|
||||
return POINT_IN_RECT (root_x, root_y, rect);
|
||||
}
|
||||
|
||||
static MetaWindow*
|
||||
static gboolean
|
||||
window_can_get_default_focus (MetaWindow *window)
|
||||
{
|
||||
if (window->unmaps_pending > 0)
|
||||
return FALSE;
|
||||
|
||||
if (window->unmanaging)
|
||||
return FALSE;
|
||||
|
||||
if (!meta_window_is_focusable (window))
|
||||
return FALSE;
|
||||
|
||||
if (!meta_window_should_be_showing (window))
|
||||
return FALSE;
|
||||
|
||||
if (window->type == META_WINDOW_DOCK)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static MetaWindow *
|
||||
get_default_focus_window (MetaStack *stack,
|
||||
MetaWorkspace *workspace,
|
||||
MetaWindow *not_this_one,
|
||||
@@ -1084,31 +1104,19 @@ get_default_focus_window (MetaStack *stack,
|
||||
if (window == not_this_one)
|
||||
continue;
|
||||
|
||||
if (window->unmaps_pending > 0)
|
||||
continue;
|
||||
|
||||
if (window->unmanaging)
|
||||
continue;
|
||||
|
||||
if (!meta_window_is_focusable (window))
|
||||
continue;
|
||||
|
||||
if (!meta_window_should_be_showing (window))
|
||||
if (!window_can_get_default_focus (window))
|
||||
continue;
|
||||
|
||||
if (must_be_at_point && !window_contains_point (window, root_x, root_y))
|
||||
continue;
|
||||
|
||||
if (window->type == META_WINDOW_DOCK)
|
||||
continue;
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MetaWindow*
|
||||
MetaWindow *
|
||||
meta_stack_get_default_focus_window_at_point (MetaStack *stack,
|
||||
MetaWorkspace *workspace,
|
||||
MetaWindow *not_this_one,
|
||||
@@ -1119,7 +1127,7 @@ meta_stack_get_default_focus_window_at_point (MetaStack *stack,
|
||||
TRUE, root_x, root_y);
|
||||
}
|
||||
|
||||
MetaWindow*
|
||||
MetaWindow *
|
||||
meta_stack_get_default_focus_window (MetaStack *stack,
|
||||
MetaWorkspace *workspace,
|
||||
MetaWindow *not_this_one)
|
||||
@@ -1128,7 +1136,7 @@ meta_stack_get_default_focus_window (MetaStack *stack,
|
||||
FALSE, 0, 0);
|
||||
}
|
||||
|
||||
GList*
|
||||
GList *
|
||||
meta_stack_list_windows (MetaStack *stack,
|
||||
MetaWorkspace *workspace)
|
||||
{
|
||||
@@ -1156,10 +1164,30 @@ meta_stack_list_windows (MetaStack *stack,
|
||||
return workspace_windows;
|
||||
}
|
||||
|
||||
GList *
|
||||
meta_stack_get_default_focus_candidates (MetaStack *stack,
|
||||
MetaWorkspace *workspace)
|
||||
{
|
||||
GList *windows = meta_stack_list_windows (stack, workspace);
|
||||
GList *l;
|
||||
|
||||
for (l = windows; l;)
|
||||
{
|
||||
GList *next = l->next;
|
||||
|
||||
if (!window_can_get_default_focus (l->data))
|
||||
windows = g_list_delete_link (windows, l);
|
||||
|
||||
l = next;
|
||||
}
|
||||
|
||||
return windows;
|
||||
}
|
||||
|
||||
int
|
||||
meta_stack_windows_cmp (MetaStack *stack,
|
||||
MetaWindow *window_a,
|
||||
MetaWindow *window_b)
|
||||
meta_stack_windows_cmp (MetaStack *stack,
|
||||
MetaWindow *window_a,
|
||||
MetaWindow *window_b)
|
||||
{
|
||||
/* -1 means a below b */
|
||||
|
||||
@@ -1192,7 +1220,7 @@ compare_just_window_stack_position (void *a,
|
||||
return 0; /* not reached */
|
||||
}
|
||||
|
||||
GList*
|
||||
GList *
|
||||
meta_stack_get_positions (MetaStack *stack)
|
||||
{
|
||||
GList *tmp;
|
||||
|
@@ -108,7 +108,7 @@ G_DECLARE_FINAL_TYPE (MetaStack, meta_stack, META, STACK, GObject)
|
||||
*
|
||||
* Returns: The new stack.
|
||||
*/
|
||||
MetaStack *meta_stack_new (MetaDisplay *display);
|
||||
MetaStack * meta_stack_new (MetaDisplay *display);
|
||||
|
||||
/**
|
||||
* meta_stack_add:
|
||||
@@ -118,8 +118,8 @@ MetaStack *meta_stack_new (MetaDisplay *display);
|
||||
* Adds a window to the local stack. It is a fatal error to call this
|
||||
* function on a window which already exists on the stack of any screen.
|
||||
*/
|
||||
void meta_stack_add (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
void meta_stack_add (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
|
||||
/**
|
||||
* meta_stack_remove:
|
||||
@@ -129,8 +129,8 @@ void meta_stack_add (MetaStack *stack,
|
||||
* Removes a window from the local stack. It is a fatal error to call this
|
||||
* function on a window which exists on the stack of any screen.
|
||||
*/
|
||||
void meta_stack_remove (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
void meta_stack_remove (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
/**
|
||||
* meta_stack_update_layer:
|
||||
* @stack: The stack to recalculate
|
||||
@@ -140,8 +140,8 @@ void meta_stack_remove (MetaStack *stack,
|
||||
* and moves them about accordingly.
|
||||
*
|
||||
*/
|
||||
void meta_stack_update_layer (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
void meta_stack_update_layer (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
|
||||
/**
|
||||
* meta_stack_update_transient:
|
||||
@@ -153,8 +153,8 @@ void meta_stack_update_layer (MetaStack *stack,
|
||||
*
|
||||
* FIXME: What's with the dummy parameter?
|
||||
*/
|
||||
void meta_stack_update_transient (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
void meta_stack_update_transient (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
|
||||
/**
|
||||
* meta_stack_raise:
|
||||
@@ -164,8 +164,8 @@ void meta_stack_update_transient (MetaStack *stack,
|
||||
*
|
||||
* Move a window to the top of its layer.
|
||||
*/
|
||||
void meta_stack_raise (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
void meta_stack_raise (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
/**
|
||||
* meta_stack_lower:
|
||||
* @stack: The stack to modify.
|
||||
@@ -173,8 +173,8 @@ void meta_stack_raise (MetaStack *stack,
|
||||
*
|
||||
* Move a window to the bottom of its layer.
|
||||
*/
|
||||
void meta_stack_lower (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
void meta_stack_lower (MetaStack *stack,
|
||||
MetaWindow *window);
|
||||
|
||||
/**
|
||||
* meta_stack_freeze:
|
||||
@@ -187,7 +187,7 @@ void meta_stack_lower (MetaStack *stack,
|
||||
* (Calls to meta_stack_freeze() nest, so that multiple calls to
|
||||
* meta_stack_freeze will require multiple calls to meta_stack_thaw().)
|
||||
*/
|
||||
void meta_stack_freeze (MetaStack *stack);
|
||||
void meta_stack_freeze (MetaStack *stack);
|
||||
|
||||
/**
|
||||
* meta_stack_thaw:
|
||||
@@ -197,7 +197,7 @@ void meta_stack_freeze (MetaStack *stack);
|
||||
* necessary during the freeze. It is an error to call this function if
|
||||
* the stack has not been frozen.
|
||||
*/
|
||||
void meta_stack_thaw (MetaStack *stack);
|
||||
void meta_stack_thaw (MetaStack *stack);
|
||||
|
||||
/**
|
||||
* meta_stack_get_top:
|
||||
@@ -208,7 +208,7 @@ void meta_stack_thaw (MetaStack *stack);
|
||||
* Returns: The top window on the stack, or %NULL in the vanishingly unlikely
|
||||
* event that you have no windows on your screen whatsoever.
|
||||
*/
|
||||
MetaWindow* meta_stack_get_top (MetaStack *stack);
|
||||
MetaWindow * meta_stack_get_top (MetaStack *stack);
|
||||
|
||||
/**
|
||||
* meta_stack_get_bottom:
|
||||
@@ -218,7 +218,7 @@ MetaWindow* meta_stack_get_top (MetaStack *stack);
|
||||
* always the desktop, this isn't the most useful of functions, and nobody
|
||||
* actually calls it. We should probably get rid of it.
|
||||
*/
|
||||
MetaWindow* meta_stack_get_bottom (MetaStack *stack);
|
||||
MetaWindow * meta_stack_get_bottom (MetaStack *stack);
|
||||
|
||||
/**
|
||||
* meta_stack_get_above:
|
||||
@@ -234,7 +234,7 @@ MetaWindow* meta_stack_get_bottom (MetaStack *stack);
|
||||
* Returns: %NULL if there is no such window;
|
||||
* the window above @window otherwise.
|
||||
*/
|
||||
MetaWindow* meta_stack_get_above (MetaStack *stack,
|
||||
MetaWindow * meta_stack_get_above (MetaStack *stack,
|
||||
MetaWindow *window,
|
||||
gboolean only_within_layer);
|
||||
|
||||
@@ -253,7 +253,7 @@ MetaWindow* meta_stack_get_above (MetaStack *stack,
|
||||
* Returns: %NULL if there is no such window;
|
||||
* the window below @window otherwise.
|
||||
*/
|
||||
MetaWindow* meta_stack_get_below (MetaStack *stack,
|
||||
MetaWindow * meta_stack_get_below (MetaStack *stack,
|
||||
MetaWindow *window,
|
||||
gboolean only_within_layer);
|
||||
|
||||
@@ -276,9 +276,9 @@ MetaWindow* meta_stack_get_below (MetaStack *stack,
|
||||
*
|
||||
* Returns: The window matching all these constraints or %NULL if none does.
|
||||
*/
|
||||
MetaWindow* meta_stack_get_default_focus_window (MetaStack *stack,
|
||||
MetaWorkspace *workspace,
|
||||
MetaWindow *not_this_one);
|
||||
MetaWindow * meta_stack_get_default_focus_window (MetaStack *stack,
|
||||
MetaWorkspace *workspace,
|
||||
MetaWindow *not_this_one);
|
||||
|
||||
/**
|
||||
* meta_stack_get_default_focus_window_at_point:
|
||||
@@ -302,11 +302,26 @@ MetaWindow* meta_stack_get_default_focus_window (MetaStack *stack,
|
||||
*
|
||||
* Returns: The window matching all these constraints or %NULL if none does.
|
||||
*/
|
||||
MetaWindow* meta_stack_get_default_focus_window_at_point (MetaStack *stack,
|
||||
MetaWorkspace *workspace,
|
||||
MetaWindow *not_this_one,
|
||||
int root_x,
|
||||
int root_y);
|
||||
MetaWindow * meta_stack_get_default_focus_window_at_point (MetaStack *stack,
|
||||
MetaWorkspace *workspace,
|
||||
MetaWindow *not_this_one,
|
||||
int root_x,
|
||||
int root_y);
|
||||
|
||||
/**
|
||||
* meta_stack_get_default_focus_candidates:
|
||||
* @stack: The stack to examine.
|
||||
* @workspace: If not %NULL, only windows on this workspace will be
|
||||
* returned; otherwise all windows in the stack will be
|
||||
* returned.
|
||||
*
|
||||
* Returns all the focus candidate windows in the stack, in order.
|
||||
*
|
||||
* Returns: (transfer container) (element-type Meta.Window):
|
||||
* A #GList of #MetaWindow, in stacking order, honouring layers.
|
||||
*/
|
||||
GList * meta_stack_get_default_focus_candidates (MetaStack *stack,
|
||||
MetaWorkspace *workspace);
|
||||
|
||||
/**
|
||||
* meta_stack_list_windows:
|
||||
@@ -317,10 +332,11 @@ MetaWindow* meta_stack_get_default_focus_window_at_point (MetaStack *stack,
|
||||
*
|
||||
* Finds all the windows in the stack, in order.
|
||||
*
|
||||
* Returns: A list of windows, in stacking order, honouring layers.
|
||||
* Returns: (transfer container) (element-type Meta.Window):
|
||||
* A list of windows, in stacking order, honouring layers.
|
||||
*/
|
||||
GList* meta_stack_list_windows (MetaStack *stack,
|
||||
MetaWorkspace *workspace);
|
||||
GList * meta_stack_list_windows (MetaStack *stack,
|
||||
MetaWorkspace *workspace);
|
||||
|
||||
/**
|
||||
* meta_stack_windows_cmp:
|
||||
@@ -341,9 +357,9 @@ GList* meta_stack_list_windows (MetaStack *stack,
|
||||
* \return -1 if window_a is below window_b, honouring layers; 1 if it's
|
||||
* above it; 0 if you passed in the same window twice!
|
||||
*/
|
||||
int meta_stack_windows_cmp (MetaStack *stack,
|
||||
MetaWindow *window_a,
|
||||
MetaWindow *window_b);
|
||||
int meta_stack_windows_cmp (MetaStack *stack,
|
||||
MetaWindow *window_a,
|
||||
MetaWindow *window_b);
|
||||
|
||||
/**
|
||||
* meta_window_set_stack_position:
|
||||
@@ -365,12 +381,13 @@ void meta_window_set_stack_position (MetaWindow *window,
|
||||
*
|
||||
* Returns the current stack state, allowing rudimentary transactions.
|
||||
*
|
||||
* Returns: An opaque GList representing the current stack sort order;
|
||||
* Returns: (transfer container) (element-type Meta.Window):
|
||||
* An opaque #GList representing the current stack sort order;
|
||||
* it is the caller's responsibility to free it.
|
||||
* Pass this to meta_stack_set_positions() later if you want to restore
|
||||
* the state to where it was when you called this function.
|
||||
*/
|
||||
GList* meta_stack_get_positions (MetaStack *stack);
|
||||
GList * meta_stack_get_positions (MetaStack *stack);
|
||||
|
||||
/**
|
||||
* meta_stack_set_positions:
|
||||
@@ -381,8 +398,8 @@ GList* meta_stack_get_positions (MetaStack *stack);
|
||||
* meta_stack_get_positions().
|
||||
*
|
||||
*/
|
||||
void meta_stack_set_positions (MetaStack *stack,
|
||||
GList *windows);
|
||||
void meta_stack_set_positions (MetaStack *stack,
|
||||
GList *windows);
|
||||
|
||||
void meta_stack_update_window_tile_matches (MetaStack *stack,
|
||||
MetaWorkspace *workspace);
|
||||
|
@@ -8267,7 +8267,9 @@ meta_window_handle_ungrabbed_event (MetaWindow *window,
|
||||
MetaDisplay *display = window->display;
|
||||
gboolean unmodified;
|
||||
gboolean is_window_grab;
|
||||
gboolean is_window_button_grab_allowed;
|
||||
ClutterModifierType grab_mods, event_mods;
|
||||
ClutterInputDevice *source;
|
||||
gfloat x, y;
|
||||
guint button;
|
||||
|
||||
@@ -8339,7 +8341,11 @@ meta_window_handle_ungrabbed_event (MetaWindow *window,
|
||||
grab_mods = meta_display_get_window_grab_modifiers (display);
|
||||
event_mods = clutter_event_get_state (event);
|
||||
unmodified = (event_mods & grab_mods) == 0;
|
||||
is_window_grab = (event_mods & grab_mods) == grab_mods;
|
||||
source = clutter_event_get_source_device (event);
|
||||
is_window_button_grab_allowed = !display->focus_window ||
|
||||
!meta_window_shortcuts_inhibited (display->focus_window, source);
|
||||
is_window_grab = (is_window_button_grab_allowed &&
|
||||
((event_mods & grab_mods) == grab_mods));
|
||||
|
||||
clutter_event_get_coords (event, &x, &y);
|
||||
|
||||
|
@@ -35,9 +35,6 @@
|
||||
META_EXPORT
|
||||
ClutterActor *meta_get_stage_for_display (MetaDisplay *display);
|
||||
|
||||
META_EXPORT
|
||||
Window meta_get_overlay_window (MetaDisplay *display);
|
||||
|
||||
META_EXPORT
|
||||
GList *meta_get_window_actors (MetaDisplay *display);
|
||||
|
||||
|
@@ -82,10 +82,6 @@ META_EXPORT
|
||||
void meta_compositor_window_opacity_changed (MetaCompositor *compositor,
|
||||
MetaWindow *window);
|
||||
|
||||
META_EXPORT
|
||||
void meta_compositor_window_surface_changed (MetaCompositor *compositor,
|
||||
MetaWindow *window);
|
||||
|
||||
META_EXPORT
|
||||
gboolean meta_compositor_process_event (MetaCompositor *compositor,
|
||||
XEvent *event,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user