Compare commits
94 Commits
wip/nields
...
wip/nielsd
Author | SHA1 | Date | |
---|---|---|---|
![]() |
020b8ea8ed | ||
![]() |
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 && \
|
||||
|
||||
|
35
NEWS
35
NEWS
@@ -1,3 +1,38 @@
|
||||
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);
|
||||
|
@@ -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);
|
||||
|
@@ -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',
|
||||
|
@@ -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
|
||||
|
@@ -46,4 +46,3 @@
|
||||
#mesondefine COGL_HAS_X11_SUPPORT
|
||||
#mesondefine COGL_HAS_XLIB
|
||||
#mesondefine COGL_HAS_XLIB_SUPPORT
|
||||
#mesondefine COGL_HAS_LIBDRM
|
||||
|
@@ -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 */
|
||||
|
@@ -29,7 +29,6 @@
|
||||
*/
|
||||
|
||||
#include "cogl-config.h"
|
||||
#include "cogl-defines.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
@@ -309,66 +308,3 @@ cogl_pixel_format_to_string (CoglPixelFormat format)
|
||||
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
#ifdef COGL_HAS_LIBDRM
|
||||
|
||||
typedef struct _PixelFormatMap {
|
||||
uint32_t drm_format;
|
||||
CoglPixelFormat cogl_format;
|
||||
CoglTextureComponents cogl_components;
|
||||
} PixelFormatMap;
|
||||
|
||||
static const PixelFormatMap pixel_format_map[] = {
|
||||
/* DRM formats are defined as little-endian, not machine endian. */
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
{ DRM_FORMAT_RGB565, COGL_PIXEL_FORMAT_RGB_565, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_ABGR8888, COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_XBGR8888, COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_ARGB8888, COGL_PIXEL_FORMAT_BGRA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_XRGB8888, COGL_PIXEL_FORMAT_BGRA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_BGRA8888, COGL_PIXEL_FORMAT_ARGB_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_BGRX8888, COGL_PIXEL_FORMAT_ARGB_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_RGBA8888, COGL_PIXEL_FORMAT_ABGR_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_RGBX8888, COGL_PIXEL_FORMAT_ABGR_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
#elif G_BYTE_ORDER == G_BIG_ENDIAN
|
||||
/* DRM_FORMAT_RGB565 cannot be expressed. */
|
||||
{ DRM_FORMAT_ABGR8888, COGL_PIXEL_FORMAT_ABGR_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_XBGR8888, COGL_PIXEL_FORMAT_ABGR_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_ARGB8888, COGL_PIXEL_FORMAT_ARGB_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_XRGB8888, COGL_PIXEL_FORMAT_ARGB_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_BGRA8888, COGL_PIXEL_FORMAT_BGRA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_BGRX8888, COGL_PIXEL_FORMAT_BGRA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_RGBA8888, COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_RGBX8888, COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
#else
|
||||
#error "unexpected G_BYTE_ORDER"
|
||||
#endif
|
||||
};
|
||||
|
||||
gboolean
|
||||
cogl_pixel_format_from_drm_format (uint32_t drm_format,
|
||||
CoglPixelFormat *out_format,
|
||||
CoglTextureComponents *out_components)
|
||||
{
|
||||
const size_t n = G_N_ELEMENTS (pixel_format_map);
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (pixel_format_map[i].drm_format == drm_format)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == n)
|
||||
return FALSE;
|
||||
|
||||
if (out_format)
|
||||
*out_format = pixel_format_map[i].cogl_format;
|
||||
|
||||
if (out_components)
|
||||
*out_components = pixel_format_map[i].cogl_components;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -38,12 +38,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef COGL_HAS_LIBDRM
|
||||
#include <drm_fourcc.h>
|
||||
#endif
|
||||
|
||||
#include <cogl/cogl-defines.h>
|
||||
#include <cogl/cogl-texture-components.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib-object.h>
|
||||
@@ -63,9 +58,6 @@ G_BEGIN_DECLS
|
||||
*
|
||||
* Other examples of factors that can influence the layout in memory are the
|
||||
* system's endianness.
|
||||
*
|
||||
* This file also contains methods to map Linux DRM 4CC codes to
|
||||
* CoglPixelFormats.
|
||||
*/
|
||||
|
||||
#define COGL_A_BIT (1 << 4)
|
||||
@@ -303,34 +295,6 @@ _cogl_pixel_format_is_endian_dependant (CoglPixelFormat format);
|
||||
const char *
|
||||
cogl_pixel_format_to_string (CoglPixelFormat format);
|
||||
|
||||
#ifdef COGL_HAS_LIBDRM
|
||||
|
||||
/* added in libdrm 2.4.95 */
|
||||
#ifndef DRM_FORMAT_INVALID
|
||||
#define DRM_FORMAT_INVALID 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* cogl_pixel_format_from_drm_format:
|
||||
* @drm_format: The DRM 4CC code (as specified in drm_fourcc.h)
|
||||
* @out_format: (out) (optional): The corresponding #CoglPixelFormat (if successful)
|
||||
* @out_components: (out) (optional): The corresponding #CoglTextureComponents,
|
||||
* if sucessful.
|
||||
*
|
||||
* Does an internal lookup to find a #CoglPixelFormat that matches the given
|
||||
* DRM 4CC code. If no such format could be found, this function will return
|
||||
* %FALSE and the output parameters will stay untouched.
|
||||
*
|
||||
* Returns: %TRUE if a #CoglPixelFormat corresponding to the 4CC code exists,
|
||||
* %FALSE otherwise.
|
||||
*/
|
||||
gboolean
|
||||
cogl_pixel_format_from_drm_format (uint32_t drm_format,
|
||||
CoglPixelFormat *out_format,
|
||||
CoglTextureComponents *out_components);
|
||||
|
||||
#endif /* COGL_HAS_LIBDRM */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __COGL_PIXEL_FORMAT_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,
|
||||
|
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* Cogl
|
||||
*
|
||||
* A Low Level GPU Graphics and Utilities API
|
||||
*
|
||||
* Copyright (C) 2007,2008,2009,2010 Intel Corporation.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use, copy,
|
||||
* modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
* of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#if !defined(__COGL_H_INSIDE__) && !defined(COGL_COMPILATION)
|
||||
#error "Only <cogl/cogl.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#ifndef __COGL_TEXTURE_COMPONENTS_H__
|
||||
#define __COGL_TEXTURE_COMPONENTS_H__
|
||||
|
||||
#include <cogl/cogl-types.h>
|
||||
#include <cogl/cogl-macros.h>
|
||||
#include <cogl/cogl-defines.h>
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* SECTION:cogl-texture-components
|
||||
* @short_description: Functions for creating and manipulating textures
|
||||
*
|
||||
* CoglTextureComponents can be used to specify what components of a
|
||||
* #CoglTexture can be used for sampling later. This affects how data is
|
||||
* uploaded to the GPU.
|
||||
*/
|
||||
|
||||
/**
|
||||
* CoglTextureComponents:
|
||||
* @COGL_TEXTURE_COMPONENTS_A: Only the alpha component
|
||||
* @COGL_TEXTURE_COMPONENTS_RG: Red and green components. Note that
|
||||
* this can only be used if the %COGL_FEATURE_ID_TEXTURE_RG feature
|
||||
* is advertised.
|
||||
* @COGL_TEXTURE_COMPONENTS_RGB: Red, green and blue components
|
||||
* @COGL_TEXTURE_COMPONENTS_RGBA: Red, green, blue and alpha components
|
||||
* @COGL_TEXTURE_COMPONENTS_DEPTH: Only a depth component
|
||||
*
|
||||
* See cogl_texture_set_components().
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef enum _CoglTextureComponents
|
||||
{
|
||||
COGL_TEXTURE_COMPONENTS_A = 1,
|
||||
COGL_TEXTURE_COMPONENTS_RG,
|
||||
COGL_TEXTURE_COMPONENTS_RGB,
|
||||
COGL_TEXTURE_COMPONENTS_RGBA,
|
||||
COGL_TEXTURE_COMPONENTS_DEPTH
|
||||
} CoglTextureComponents;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __COGL_TEXTURE_COMPONENTS_H__ */
|
@@ -122,6 +122,29 @@ uint32_t cogl_texture_error_quark (void);
|
||||
gboolean
|
||||
cogl_is_texture (void *object);
|
||||
|
||||
/**
|
||||
* CoglTextureComponents:
|
||||
* @COGL_TEXTURE_COMPONENTS_A: Only the alpha component
|
||||
* @COGL_TEXTURE_COMPONENTS_RG: Red and green components. Note that
|
||||
* this can only be used if the %COGL_FEATURE_ID_TEXTURE_RG feature
|
||||
* is advertised.
|
||||
* @COGL_TEXTURE_COMPONENTS_RGB: Red, green and blue components
|
||||
* @COGL_TEXTURE_COMPONENTS_RGBA: Red, green, blue and alpha components
|
||||
* @COGL_TEXTURE_COMPONENTS_DEPTH: Only a depth component
|
||||
*
|
||||
* See cogl_texture_set_components().
|
||||
*
|
||||
* Since: 1.18
|
||||
*/
|
||||
typedef enum _CoglTextureComponents
|
||||
{
|
||||
COGL_TEXTURE_COMPONENTS_A = 1,
|
||||
COGL_TEXTURE_COMPONENTS_RG,
|
||||
COGL_TEXTURE_COMPONENTS_RGB,
|
||||
COGL_TEXTURE_COMPONENTS_RGBA,
|
||||
COGL_TEXTURE_COMPONENTS_DEPTH
|
||||
} CoglTextureComponents;
|
||||
|
||||
/**
|
||||
* cogl_texture_set_components:
|
||||
* @texture: a #CoglTexture pointer.
|
||||
|
@@ -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);
|
||||
|
@@ -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,
|
||||
|
@@ -12,7 +12,6 @@ cdata.set('COGL_HAS_X11', have_x11)
|
||||
cdata.set('COGL_HAS_X11_SUPPORT', have_x11)
|
||||
cdata.set('COGL_HAS_XLIB', have_x11)
|
||||
cdata.set('COGL_HAS_XLIB_SUPPORT', have_x11)
|
||||
cdata.set('COGL_HAS_LIBDRM', have_native_backend and libdrm_dep.found())
|
||||
|
||||
cogl_defines_h = configure_file(
|
||||
input: 'cogl-defines.h.meson',
|
||||
@@ -94,7 +93,6 @@ cogl_headers = [
|
||||
'cogl-texture.h',
|
||||
'cogl-texture-2d.h',
|
||||
'cogl-texture-2d-sliced.h',
|
||||
'cogl-texture-components.h',
|
||||
'cogl-types.h',
|
||||
'cogl.h',
|
||||
]
|
||||
|
116
data/uncrustify.cfg
Normal file
116
data/uncrustify.cfg
Normal file
@@ -0,0 +1,116 @@
|
||||
# Enorces the code style of Mutter (based on GNU)
|
||||
|
||||
code_width = 80
|
||||
|
||||
# indent using tabs
|
||||
output_tab_size = 2
|
||||
indent_columns = output_tab_size
|
||||
indent_with_tabs = 0
|
||||
indent_brace = 2
|
||||
indent_braces = false
|
||||
indent_braces_no_func = True
|
||||
indent_func_call_param = false
|
||||
indent_func_def_param = false
|
||||
indent_func_proto_param = false
|
||||
indent_switch_case = 0
|
||||
indent_case_brace = 2
|
||||
indent_paren_close = 1
|
||||
|
||||
# newlines
|
||||
newlines = lf
|
||||
nl_after_semicolon = true
|
||||
nl_start_of_file = remove
|
||||
nl_end_of_file = force
|
||||
nl_end_of_file_min = 1
|
||||
|
||||
# spaces
|
||||
sp_return_paren = add # "return (1);" vs "return(1);"
|
||||
sp_sizeof_paren = add # "sizeof (int)" vs "sizeof(int)"
|
||||
sp_assign = add
|
||||
sp_arith = add
|
||||
sp_bool = add
|
||||
sp_compare = add
|
||||
sp_after_comma = add
|
||||
sp_case_label = add
|
||||
sp_else_brace = add
|
||||
sp_brace_else = add
|
||||
sp_func_call_paren = add # "foo (" vs "foo("
|
||||
sp_func_proto_paren = add # "int foo ();" vs "int foo();"
|
||||
sp_before_ptr_star = add
|
||||
sp_after_ptr_star_qualifier = add # "const char * const" vs. "const char *const"
|
||||
sp_after_ptr_star = remove
|
||||
sp_between_ptr_star = remove # "**var" vs "* *var"
|
||||
sp_inside_paren = remove # "( 1 )" vs "(1)"
|
||||
sp_inside_fparen = remove # "( 1 )" vs "(1)" - functions
|
||||
sp_inside_sparen = remove # "( 1 )" vs "(1)" - if/for/etc
|
||||
sp_after_cast = add # "(int) a" vs "(int)a"
|
||||
sp_func_call_user_paren = remove # For gettext, "_()" vs. "_ ()"
|
||||
set func_call_user _ N_ C_ # Needed for sp_after_cast
|
||||
sp_before_semi = remove
|
||||
sp_paren_paren = remove # Space between (( and ))
|
||||
|
||||
eat_blanks_before_close_brace = true
|
||||
eat_blanks_after_open_brace = true
|
||||
|
||||
# Style for curly braces
|
||||
nl_assign_brace = add
|
||||
nl_enum_brace = add
|
||||
nl_union_brace = add
|
||||
nl_struct_brace = add
|
||||
nl_class_brace = add
|
||||
nl_do_brace = add
|
||||
nl_if_brace = add
|
||||
nl_for_brace = add
|
||||
nl_else_brace = add
|
||||
nl_elseif_brace = add
|
||||
nl_while_brace = add
|
||||
nl_switch_brace = add
|
||||
nl_fcall_brace = add
|
||||
nl_fdef_brace = add
|
||||
nl_brace_else = add
|
||||
nl_brace_while = add
|
||||
nl_case_colon_brace = add
|
||||
nl_after_brace_open = true
|
||||
|
||||
# Function calls and parameters
|
||||
nl_func_paren = remove
|
||||
nl_func_def_paren = remove
|
||||
nl_func_decl_start = remove
|
||||
nl_func_def_start = remove
|
||||
nl_func_decl_args = ignore
|
||||
nl_func_def_args = ignore
|
||||
nl_func_decl_args_multi_line = true
|
||||
nl_func_def_args_multi_line = true
|
||||
nl_func_decl_end = remove
|
||||
nl_func_def_end = remove
|
||||
|
||||
# Code modifying options (non-whitespace)
|
||||
mod_full_brace_function = force
|
||||
mod_remove_extra_semicolon = true
|
||||
|
||||
# Align
|
||||
align_func_params = true
|
||||
align_single_line_func = true
|
||||
align_var_def_star_style = 2
|
||||
|
||||
# one liners
|
||||
nl_func_leave_one_liners = true
|
||||
nl_enum_leave_one_liners = true
|
||||
nl_assign_leave_one_liners = true
|
||||
|
||||
# Comments
|
||||
cmt_cpp_to_c = true # "/* */" vs. "//"
|
||||
cmt_convert_tab_to_spaces = true
|
||||
#cmt_reflow_mode = 2 # Full reflow (seems doesn't work quite well, it doesn't reorder the comments)
|
||||
cmt_width = 80 # Line width
|
||||
cmt_star_cont = true # Whether to put a star on subsequent comment lines
|
||||
cmt_sp_after_star_cont = 1 # The number of spaces to insert after the star on subsequent comment lines
|
||||
cmt_c_nl_start = false # false/true
|
||||
cmt_c_nl_end = true # false/true
|
||||
# For multi-line comments with a '*' lead, remove leading spaces if the first and last lines of
|
||||
# the comment are the same length. Default=True
|
||||
cmt_multi_check_last = false
|
||||
|
||||
# Encoding
|
||||
utf8_bom = remove
|
||||
utf8_force = true
|
@@ -1,5 +1,5 @@
|
||||
project('mutter', 'c',
|
||||
version: '3.33.2',
|
||||
version: '3.33.3',
|
||||
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"
|
||||
|
@@ -23,6 +23,9 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* This file was copied from gnome-session, so don't apply our code style */
|
||||
/* *INDENT-OFF* */
|
||||
|
||||
typedef enum {
|
||||
GSM_INHIBITOR_FLAG_LOGOUT = 1 << 0,
|
||||
GSM_INHIBITOR_FLAG_SWITCH_USER = 1 << 1,
|
||||
@@ -31,6 +34,8 @@ typedef enum {
|
||||
GSM_INHIBITOR_FLAG_AUTOMOUNT = 1 << 4
|
||||
} GsmInhibitorFlag;
|
||||
|
||||
/* *INDENT-ON* */
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSM_INHIBITOR_FLAG_H__ */
|
||||
|
@@ -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);
|
||||
|
@@ -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,12 +69,19 @@
|
||||
#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
|
||||
#define EGL_DRM_MASTER_FD_EXT 0x333C
|
||||
#endif
|
||||
|
||||
/* added in libdrm 2.4.95 */
|
||||
#ifndef DRM_FORMAT_INVALID
|
||||
#define DRM_FORMAT_INVALID 0
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
@@ -88,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
|
||||
@@ -116,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;
|
||||
@@ -133,6 +147,7 @@ typedef struct _MetaDumbBuffer
|
||||
int height;
|
||||
int stride_bytes;
|
||||
uint32_t drm_format;
|
||||
int dmabuf_fd;
|
||||
} MetaDumbBuffer;
|
||||
|
||||
typedef struct _MetaOnscreenNativeSecondaryGpuState
|
||||
@@ -154,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
|
||||
@@ -235,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);
|
||||
|
||||
@@ -246,6 +268,14 @@ static void
|
||||
free_next_secondary_bo (MetaGpuKms *gpu_kms,
|
||||
MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state);
|
||||
|
||||
static gboolean
|
||||
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)
|
||||
{
|
||||
@@ -857,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,
|
||||
@@ -865,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,
|
||||
@@ -949,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;
|
||||
}
|
||||
}
|
||||
@@ -1440,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;
|
||||
}
|
||||
}
|
||||
@@ -1747,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,
|
||||
@@ -1813,6 +1846,187 @@ 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;
|
||||
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;
|
||||
}
|
||||
|
||||
cogl_tex = cogl_egl_texture_2d_new_from_image (cogl_context,
|
||||
dumb_fb->width,
|
||||
dumb_fb->height,
|
||||
cogl_format,
|
||||
egl_image,
|
||||
&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;
|
||||
CoglTextureComponents cogl_components;
|
||||
} PixelFormatMap;
|
||||
|
||||
static const PixelFormatMap pixel_format_map[] = {
|
||||
/* DRM formats are defined as little-endian, not machine endian. */
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
{ DRM_FORMAT_RGB565, COGL_PIXEL_FORMAT_RGB_565, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_ABGR8888, COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_XBGR8888, COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_ARGB8888, COGL_PIXEL_FORMAT_BGRA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_XRGB8888, COGL_PIXEL_FORMAT_BGRA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_BGRA8888, COGL_PIXEL_FORMAT_ARGB_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_BGRX8888, COGL_PIXEL_FORMAT_ARGB_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_RGBA8888, COGL_PIXEL_FORMAT_ABGR_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_RGBX8888, COGL_PIXEL_FORMAT_ABGR_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
#elif G_BYTE_ORDER == G_BIG_ENDIAN
|
||||
/* DRM_FORMAT_RGB565 cannot be expressed. */
|
||||
{ DRM_FORMAT_ABGR8888, COGL_PIXEL_FORMAT_ABGR_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_XBGR8888, COGL_PIXEL_FORMAT_ABGR_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_ARGB8888, COGL_PIXEL_FORMAT_ARGB_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_XRGB8888, COGL_PIXEL_FORMAT_ARGB_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_BGRA8888, COGL_PIXEL_FORMAT_BGRA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_BGRX8888, COGL_PIXEL_FORMAT_BGRA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
{ DRM_FORMAT_RGBA8888, COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGBA },
|
||||
{ DRM_FORMAT_RGBX8888, COGL_PIXEL_FORMAT_RGBA_8888_PRE, COGL_TEXTURE_COMPONENTS_RGB },
|
||||
#else
|
||||
#error "unexpected G_BYTE_ORDER"
|
||||
#endif
|
||||
};
|
||||
|
||||
static gboolean
|
||||
cogl_pixel_format_from_drm_format (uint32_t drm_format,
|
||||
CoglPixelFormat *out_format,
|
||||
CoglTextureComponents *out_components)
|
||||
{
|
||||
const size_t n = G_N_ELEMENTS (pixel_format_map);
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (pixel_format_map[i].drm_format == drm_format)
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == n)
|
||||
return FALSE;
|
||||
|
||||
if (out_format)
|
||||
*out_format = pixel_format_map[i].cogl_format;
|
||||
|
||||
if (out_components)
|
||||
*out_components = pixel_format_map[i].cogl_components;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
copy_shared_framebuffer_cpu (CoglOnscreen *onscreen,
|
||||
MetaOnscreenNativeSecondaryGpuState *secondary_gpu_state,
|
||||
@@ -1826,6 +2040,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);
|
||||
@@ -1876,13 +2093,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;
|
||||
}
|
||||
}
|
||||
@@ -1910,13 +2144,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;
|
||||
}
|
||||
@@ -2389,6 +2623,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;
|
||||
|
||||
@@ -2406,6 +2641,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)
|
||||
@@ -2416,6 +2678,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;
|
||||
|
||||
@@ -2564,8 +2829,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;
|
||||
@@ -2619,6 +2882,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,
|
||||
@@ -2674,7 +2939,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);
|
||||
@@ -3041,6 +3306,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)
|
||||
{
|
||||
@@ -3271,7 +3553,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;
|
||||
|
||||
@@ -3291,7 +3578,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
|
||||
@@ -3865,6 +4152,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,
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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,10 @@ 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);
|
||||
|
||||
#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
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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,21 @@ 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 +179,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 +491,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 +583,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");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -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,
|
||||
|
@@ -10,10 +10,15 @@
|
||||
#define META_TYPE_BACKGROUND_GROUP (meta_background_group_get_type ())
|
||||
|
||||
META_EXPORT
|
||||
G_DECLARE_FINAL_TYPE (MetaBackgroundGroup,
|
||||
meta_background_group,
|
||||
META, BACKGROUND_GROUP,
|
||||
ClutterActor)
|
||||
G_DECLARE_DERIVABLE_TYPE (MetaBackgroundGroup,
|
||||
meta_background_group,
|
||||
META, BACKGROUND_GROUP,
|
||||
ClutterActor)
|
||||
|
||||
struct _MetaBackgroundGroupClass
|
||||
{
|
||||
ClutterActorClass parent_class;
|
||||
};
|
||||
|
||||
META_EXPORT
|
||||
ClutterActor *meta_background_group_new (void);
|
||||
|
@@ -55,6 +55,9 @@ void meta_cursor_tracker_get_pointer (MetaCursorTracker *tracker,
|
||||
int *y,
|
||||
ClutterModifierType *mods);
|
||||
|
||||
META_EXPORT
|
||||
gboolean meta_cursor_tracker_get_pointer_visible (MetaCursorTracker *tracker);
|
||||
|
||||
META_EXPORT
|
||||
void meta_cursor_tracker_set_pointer_visible (MetaCursorTracker *tracker,
|
||||
gboolean visible);
|
||||
|
@@ -57,6 +57,11 @@ MetaWorkspace *meta_workspace_manager_append_new_workspace (MetaWorkspaceManager
|
||||
gboolean activate,
|
||||
guint32 timestamp);
|
||||
|
||||
META_EXPORT
|
||||
void meta_workspace_manager_reorder_workspace (MetaWorkspaceManager *workspace_manager,
|
||||
MetaWorkspace *workspace,
|
||||
int new_index);
|
||||
|
||||
META_EXPORT
|
||||
int meta_workspace_manager_get_active_workspace_index (MetaWorkspaceManager *workspace_manager);
|
||||
|
||||
|
@@ -115,6 +115,9 @@ stacking_tests = [
|
||||
'closed-transient-no-input-no-take-focus-parents',
|
||||
'closed-transient-no-input-parent',
|
||||
'closed-transient-no-input-parent-delayed-focus-default-cancelled',
|
||||
'closed-transient-no-input-parents',
|
||||
'closed-transient-no-input-parents-queued-default-focus-destroyed',
|
||||
'closed-transient-only-take-focus-parents',
|
||||
'minimized',
|
||||
'mixed-windows',
|
||||
'set-parent',
|
||||
|
@@ -20,7 +20,7 @@ assert_focused 1/3
|
||||
assert_stacking 2/1 1/1 1/2 1/3
|
||||
|
||||
destroy 1/3
|
||||
sleep 10
|
||||
dispatch
|
||||
|
||||
assert_focused none
|
||||
assert_stacking 2/1 1/1 1/2
|
||||
|
@@ -25,6 +25,6 @@ dispatch
|
||||
assert_focused none
|
||||
assert_stacking 2/1 1/1 1/2
|
||||
|
||||
sleep 250
|
||||
sleep 150
|
||||
assert_focused 1/1
|
||||
assert_stacking 2/1 1/1 1/2
|
||||
|
@@ -0,0 +1,43 @@
|
||||
new_client 0 x11
|
||||
create 0/1
|
||||
show 0/1
|
||||
|
||||
new_client 1 x11
|
||||
create 1/1
|
||||
show 1/1
|
||||
|
||||
create 1/2 csd
|
||||
set_parent 1/2 1
|
||||
accept_focus 1/2 false
|
||||
show 1/2
|
||||
|
||||
create 1/3 csd
|
||||
set_parent 1/3 2
|
||||
accept_focus 1/3 false
|
||||
show 1/3
|
||||
|
||||
create 1/4 csd
|
||||
set_parent 1/4 3
|
||||
accept_focus 1/4 false
|
||||
show 1/4
|
||||
|
||||
create 1/5 csd
|
||||
set_parent 1/5 3
|
||||
show 1/5
|
||||
|
||||
wait
|
||||
assert_focused 1/5
|
||||
assert_stacking 0/1 1/1 1/2 1/3 1/4 1/5
|
||||
|
||||
destroy 1/5
|
||||
dispatch
|
||||
|
||||
assert_focused none
|
||||
assert_stacking 0/1 1/1 1/2 1/3 1/4
|
||||
|
||||
destroy 1/2
|
||||
dispatch
|
||||
|
||||
sleep 450
|
||||
assert_focused 1/1
|
||||
assert_stacking 0/1 1/1 1/3 1/4
|
@@ -0,0 +1,46 @@
|
||||
new_client 0 x11
|
||||
create 0/1
|
||||
show 0/1
|
||||
|
||||
new_client 1 x11
|
||||
create 1/1
|
||||
show 1/1
|
||||
|
||||
create 1/2 csd
|
||||
set_parent 1/2 1
|
||||
accept_focus 1/2 false
|
||||
show 1/2
|
||||
|
||||
create 1/3 csd
|
||||
set_parent 1/3 2
|
||||
accept_focus 1/3 false
|
||||
show 1/3
|
||||
|
||||
create 1/4 csd
|
||||
set_parent 1/4 3
|
||||
accept_focus 1/4 false
|
||||
show 1/4
|
||||
|
||||
create 1/5 csd
|
||||
set_parent 1/5 3
|
||||
show 1/5
|
||||
|
||||
wait
|
||||
assert_focused 1/5
|
||||
assert_stacking 0/1 1/1 1/2 1/3 1/4 1/5
|
||||
|
||||
destroy 1/5
|
||||
dispatch
|
||||
|
||||
assert_focused none
|
||||
assert_stacking 0/1 1/1 1/2 1/3 1/4
|
||||
|
||||
sleep 600
|
||||
assert_focused 1/1
|
||||
assert_stacking 0/1 1/1 1/2 1/3 1/4
|
||||
|
||||
destroy 1/3
|
||||
wait
|
||||
|
||||
assert_focused 1/1
|
||||
assert_stacking 0/1 1/1 1/2 1/4
|
@@ -0,0 +1,34 @@
|
||||
new_client 0 x11
|
||||
create 0/1
|
||||
show 0/1
|
||||
|
||||
new_client 1 x11
|
||||
create 1/1
|
||||
accept_focus 1/1 false
|
||||
can_take_focus 1/1 true
|
||||
accept_take_focus 1/1 true
|
||||
show 1/1
|
||||
|
||||
create 1/2 csd
|
||||
set_parent 1/2 1
|
||||
accept_focus 1/2 false
|
||||
can_take_focus 1/2 true
|
||||
accept_take_focus 1/2 true
|
||||
show 1/2
|
||||
|
||||
create 1/3
|
||||
set_parent 1/3 2
|
||||
show 1/3
|
||||
|
||||
assert_focused 1/3
|
||||
assert_stacking 0/1 1/1 1/2 1/3
|
||||
|
||||
destroy 1/3
|
||||
wait
|
||||
|
||||
assert_focused 1/2
|
||||
assert_stacking 0/1 1/1 1/2
|
||||
|
||||
sleep 150
|
||||
assert_focused 1/2
|
||||
assert_stacking 0/1 1/1 1/2
|
@@ -31,6 +31,11 @@
|
||||
const char *client_id = "0";
|
||||
static gboolean wayland;
|
||||
GHashTable *windows;
|
||||
GQuark event_source_quark;
|
||||
GQuark event_handlers_quark;
|
||||
GQuark can_take_focus_quark;
|
||||
|
||||
typedef void (*XEventHandler) (GtkWidget *window, XEvent *event);
|
||||
|
||||
static void read_next_line (GDataInputStream *in);
|
||||
|
||||
@@ -57,6 +62,186 @@ lookup_window (const char *window_id)
|
||||
return window;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
GSource base;
|
||||
GSource **self_ref;
|
||||
GPollFD event_poll_fd;
|
||||
Display *xdisplay;
|
||||
} XClientEventSource;
|
||||
|
||||
static gboolean
|
||||
x_event_source_prepare (GSource *source,
|
||||
int *timeout)
|
||||
{
|
||||
XClientEventSource *x_source = (XClientEventSource *) source;
|
||||
|
||||
*timeout = -1;
|
||||
|
||||
return XPending (x_source->xdisplay);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
x_event_source_check (GSource *source)
|
||||
{
|
||||
XClientEventSource *x_source = (XClientEventSource *) source;
|
||||
|
||||
return XPending (x_source->xdisplay);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
x_event_source_dispatch (GSource *source,
|
||||
GSourceFunc callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
XClientEventSource *x_source = (XClientEventSource *) source;
|
||||
|
||||
while (XPending (x_source->xdisplay))
|
||||
{
|
||||
GHashTableIter iter;
|
||||
XEvent event;
|
||||
gpointer value;
|
||||
|
||||
XNextEvent (x_source->xdisplay, &event);
|
||||
|
||||
g_hash_table_iter_init (&iter, windows);
|
||||
while (g_hash_table_iter_next (&iter, NULL, &value))
|
||||
{
|
||||
GList *l;
|
||||
GtkWidget *window = value;
|
||||
GList *handlers =
|
||||
g_object_get_qdata (G_OBJECT (window), event_handlers_quark);
|
||||
|
||||
for (l = handlers; l; l = l->next)
|
||||
{
|
||||
XEventHandler handler = l->data;
|
||||
handler (window, &event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
x_event_source_finalize (GSource *source)
|
||||
{
|
||||
XClientEventSource *x_source = (XClientEventSource *) source;
|
||||
|
||||
*x_source->self_ref = NULL;
|
||||
}
|
||||
|
||||
static GSourceFuncs x_event_funcs = {
|
||||
x_event_source_prepare,
|
||||
x_event_source_check,
|
||||
x_event_source_dispatch,
|
||||
x_event_source_finalize,
|
||||
};
|
||||
|
||||
static GSource*
|
||||
ensure_xsource_handler (GdkDisplay *gdkdisplay)
|
||||
{
|
||||
static GSource *source = NULL;
|
||||
Display *xdisplay = GDK_DISPLAY_XDISPLAY (gdkdisplay);
|
||||
XClientEventSource *x_source;
|
||||
|
||||
if (source)
|
||||
return g_source_ref (source);
|
||||
|
||||
source = g_source_new (&x_event_funcs, sizeof (XClientEventSource));
|
||||
x_source = (XClientEventSource *) source;
|
||||
x_source->self_ref = &source;
|
||||
x_source->xdisplay = xdisplay;
|
||||
x_source->event_poll_fd.fd = ConnectionNumber (xdisplay);
|
||||
x_source->event_poll_fd.events = G_IO_IN;
|
||||
g_source_add_poll (source, &x_source->event_poll_fd);
|
||||
|
||||
g_source_set_priority (source, GDK_PRIORITY_EVENTS - 1);
|
||||
g_source_set_can_recurse (source, TRUE);
|
||||
g_source_attach (source, NULL);
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
window_has_x11_event_handler (GtkWidget *window,
|
||||
XEventHandler handler)
|
||||
{
|
||||
GList *handlers =
|
||||
g_object_get_qdata (G_OBJECT (window), event_handlers_quark);
|
||||
|
||||
g_return_val_if_fail (handler, FALSE);
|
||||
g_return_val_if_fail (!wayland, FALSE);
|
||||
|
||||
return g_list_find (handlers, handler) != NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
unref_and_maybe_destroy_gsource (GSource *source)
|
||||
{
|
||||
g_source_unref (source);
|
||||
|
||||
if (source->ref_count == 1)
|
||||
g_source_destroy (source);
|
||||
}
|
||||
|
||||
static void
|
||||
window_add_x11_event_handler (GtkWidget *window,
|
||||
XEventHandler handler)
|
||||
{
|
||||
GSource *source;
|
||||
GList *handlers =
|
||||
g_object_get_qdata (G_OBJECT (window), event_handlers_quark);
|
||||
|
||||
g_return_if_fail (!window_has_x11_event_handler (window, handler));
|
||||
|
||||
source = ensure_xsource_handler (gtk_widget_get_display (window));
|
||||
g_object_set_qdata_full (G_OBJECT (window), event_source_quark, source,
|
||||
(GDestroyNotify) unref_and_maybe_destroy_gsource);
|
||||
|
||||
handlers = g_list_append (handlers, handler);
|
||||
g_object_set_qdata (G_OBJECT (window), event_handlers_quark, handlers);
|
||||
}
|
||||
|
||||
static void
|
||||
window_remove_x11_event_handler (GtkWidget *window,
|
||||
XEventHandler handler)
|
||||
{
|
||||
GList *handlers =
|
||||
g_object_get_qdata (G_OBJECT (window), event_handlers_quark);
|
||||
|
||||
g_return_if_fail (window_has_x11_event_handler (window, handler));
|
||||
|
||||
g_object_set_qdata (G_OBJECT (window), event_source_quark, NULL);
|
||||
|
||||
handlers = g_list_remove (handlers, handler);
|
||||
g_object_set_qdata (G_OBJECT (window), event_handlers_quark, handlers);
|
||||
}
|
||||
|
||||
static void
|
||||
handle_take_focus (GtkWidget *window,
|
||||
XEvent *xevent)
|
||||
{
|
||||
GdkWindow *gdkwindow = gtk_widget_get_window (window);
|
||||
GdkDisplay *display = gtk_widget_get_display (window);
|
||||
Atom wm_protocols =
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "WM_PROTOCOLS");
|
||||
Atom wm_take_focus =
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "WM_TAKE_FOCUS");
|
||||
|
||||
if (xevent->xany.type != ClientMessage ||
|
||||
xevent->xany.window != GDK_WINDOW_XID (gdkwindow))
|
||||
return;
|
||||
|
||||
if (xevent->xclient.message_type == wm_protocols &&
|
||||
xevent->xclient.data.l[0] == wm_take_focus)
|
||||
{
|
||||
XSetInputFocus (xevent->xany.display,
|
||||
GDK_WINDOW_XID (gdkwindow),
|
||||
RevertToParent,
|
||||
xevent->xclient.data.l[1]);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
process_line (const char *line)
|
||||
{
|
||||
@@ -125,6 +310,9 @@ process_line (const char *line)
|
||||
gtk_window_set_title (GTK_WINDOW (window), title);
|
||||
g_free (title);
|
||||
|
||||
g_object_set_qdata (G_OBJECT (window), can_take_focus_quark,
|
||||
GUINT_TO_POINTER (TRUE));
|
||||
|
||||
gtk_widget_realize (window);
|
||||
|
||||
if (!wayland)
|
||||
@@ -211,6 +399,14 @@ process_line (const char *line)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!wayland &&
|
||||
window_has_x11_event_handler (window, handle_take_focus))
|
||||
{
|
||||
g_print ("Impossible to use %s for windows accepting take focus",
|
||||
argv[1]);
|
||||
goto out;
|
||||
}
|
||||
|
||||
gboolean enabled = g_ascii_strcasecmp (argv[2], "true") == 0;
|
||||
gtk_window_set_accept_focus (GTK_WINDOW (window), enabled);
|
||||
}
|
||||
@@ -235,6 +431,13 @@ process_line (const char *line)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (window_has_x11_event_handler (window, handle_take_focus))
|
||||
{
|
||||
g_print ("Impossible to change %s for windows accepting take focus",
|
||||
argv[1]);
|
||||
goto out;
|
||||
}
|
||||
|
||||
GdkDisplay *display = gdk_display_get_default ();
|
||||
GdkWindow *gdkwindow = gtk_widget_get_window (window);
|
||||
Display *xdisplay = gdk_x11_display_get_xdisplay (display);
|
||||
@@ -260,10 +463,51 @@ process_line (const char *line)
|
||||
new_protocols[n++] = wm_take_focus;
|
||||
|
||||
XSetWMProtocols (xdisplay, xwindow, new_protocols, n);
|
||||
g_object_set_qdata (G_OBJECT (window), can_take_focus_quark,
|
||||
GUINT_TO_POINTER (add));
|
||||
|
||||
XFree (new_protocols);
|
||||
XFree (protocols);
|
||||
}
|
||||
else if (strcmp (argv[0], "accept_take_focus") == 0)
|
||||
{
|
||||
if (argc != 3)
|
||||
{
|
||||
g_print ("usage: %s <window-id> [true|false]", argv[0]);
|
||||
goto out;
|
||||
}
|
||||
|
||||
GtkWidget *window = lookup_window (argv[1]);
|
||||
if (!window)
|
||||
{
|
||||
g_print ("unknown window %s", argv[1]);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (wayland)
|
||||
{
|
||||
g_print ("%s not supported under wayland", argv[0]);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (gtk_window_get_accept_focus (GTK_WINDOW (window)))
|
||||
{
|
||||
g_print ("%s not supported for input windows", argv[0]);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!g_object_get_qdata (G_OBJECT (window), can_take_focus_quark))
|
||||
{
|
||||
g_print ("%s not supported for windows with no WM_TAKE_FOCUS set",
|
||||
argv[0]);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (g_ascii_strcasecmp (argv[2], "true") == 0)
|
||||
window_add_x11_event_handler (window, handle_take_focus);
|
||||
else
|
||||
window_remove_x11_event_handler (window, handle_take_focus);
|
||||
}
|
||||
else if (strcmp (argv[0], "show") == 0)
|
||||
{
|
||||
if (argc != 2)
|
||||
@@ -528,6 +772,9 @@ main(int argc, char **argv)
|
||||
|
||||
windows = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
g_free, NULL);
|
||||
event_source_quark = g_quark_from_static_string ("event-source");
|
||||
event_handlers_quark = g_quark_from_static_string ("event-handlers");
|
||||
can_take_focus_quark = g_quark_from_static_string ("can-take-focus");
|
||||
|
||||
GInputStream *raw_in = g_unix_input_stream_new (0, FALSE);
|
||||
GDataInputStream *in = g_data_input_stream_new (raw_in);
|
||||
|
@@ -497,6 +497,25 @@ test_case_do (TestCase *test,
|
||||
NULL))
|
||||
return FALSE;
|
||||
}
|
||||
else if (strcmp (argv[0], "accept_take_focus") == 0)
|
||||
{
|
||||
if (argc != 3 ||
|
||||
(g_ascii_strcasecmp (argv[2], "true") != 0 &&
|
||||
g_ascii_strcasecmp (argv[2], "false") != 0))
|
||||
BAD_COMMAND("usage: %s <client-id>/<window-id> [true|false]",
|
||||
argv[0]);
|
||||
|
||||
TestClient *client;
|
||||
const char *window_id;
|
||||
if (!test_case_parse_window_id (test, argv[1], &client, &window_id, error))
|
||||
return FALSE;
|
||||
|
||||
if (!test_client_do (client, error,
|
||||
argv[0], window_id,
|
||||
argv[2],
|
||||
NULL))
|
||||
return FALSE;
|
||||
}
|
||||
else if (strcmp (argv[0], "show") == 0)
|
||||
{
|
||||
if (argc != 2)
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
* Copyright (C) 2016 Red Hat Inc.
|
||||
* Copyright (C) 2017 Intel Corporation
|
||||
* Copyright (C) 2018 DisplayLink (UK) Ltd.
|
||||
* 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
|
||||
@@ -43,6 +43,10 @@
|
||||
|
||||
#include "linux-dmabuf-unstable-v1-server-protocol.h"
|
||||
|
||||
#ifndef DRM_FORMAT_MOD_INVALID
|
||||
#define DRM_FORMAT_MOD_INVALID ((1ULL << 56) - 1)
|
||||
#endif
|
||||
|
||||
#define META_WAYLAND_DMA_BUF_MAX_FDS 4
|
||||
|
||||
struct _MetaWaylandDmaBufBuffer
|
||||
@@ -55,8 +59,8 @@ struct _MetaWaylandDmaBufBuffer
|
||||
uint64_t drm_modifier;
|
||||
bool is_y_inverted;
|
||||
int fds[META_WAYLAND_DMA_BUF_MAX_FDS];
|
||||
int offsets[META_WAYLAND_DMA_BUF_MAX_FDS];
|
||||
unsigned int strides[META_WAYLAND_DMA_BUF_MAX_FDS];
|
||||
uint32_t offsets[META_WAYLAND_DMA_BUF_MAX_FDS];
|
||||
uint32_t strides[META_WAYLAND_DMA_BUF_MAX_FDS];
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (MetaWaylandDmaBufBuffer, meta_wayland_dma_buf_buffer, G_TYPE_OBJECT);
|
||||
@@ -71,99 +75,62 @@ meta_wayland_dma_buf_realize_texture (MetaWaylandBuffer *buffer,
|
||||
CoglContext *cogl_context = clutter_backend_get_cogl_context (clutter_backend);
|
||||
EGLDisplay egl_display = cogl_egl_context_get_egl_display (cogl_context);
|
||||
MetaWaylandDmaBufBuffer *dma_buf = buffer->dma_buf.dma_buf;
|
||||
uint32_t n_planes;
|
||||
uint64_t modifiers[META_WAYLAND_DMA_BUF_MAX_FDS];
|
||||
CoglPixelFormat cogl_format;
|
||||
EGLImageKHR egl_image;
|
||||
CoglTexture2D *texture;
|
||||
EGLint attribs[64];
|
||||
int attr_idx = 0;
|
||||
|
||||
if (buffer->dma_buf.texture)
|
||||
return TRUE;
|
||||
|
||||
/*
|
||||
* NOTE: The cogl_format here is only used for texture color channel
|
||||
* swizzling as compared to COGL_PIXEL_FORMAT_ARGB. It is *not* used
|
||||
* for accessing the buffer memory. EGL will access the buffer
|
||||
* memory according to the DRM fourcc code. Cogl will not mmap
|
||||
* and access the buffer memory at all.
|
||||
*/
|
||||
if (!cogl_pixel_format_from_drm_format (dma_buf->drm_format, &cogl_format, NULL))
|
||||
switch (dma_buf->drm_format)
|
||||
{
|
||||
/*
|
||||
* NOTE: The cogl_format here is only used for texture color channel
|
||||
* swizzling as compared to COGL_PIXEL_FORMAT_ARGB. It is *not* used
|
||||
* for accessing the buffer memory. EGL will access the buffer
|
||||
* memory according to the DRM fourcc code. Cogl will not mmap
|
||||
* and access the buffer memory at all.
|
||||
*/
|
||||
case DRM_FORMAT_XRGB8888:
|
||||
cogl_format = COGL_PIXEL_FORMAT_RGB_888;
|
||||
break;
|
||||
case DRM_FORMAT_ARGB8888:
|
||||
cogl_format = COGL_PIXEL_FORMAT_ARGB_8888_PRE;
|
||||
break;
|
||||
case DRM_FORMAT_ARGB2101010:
|
||||
cogl_format = COGL_PIXEL_FORMAT_ARGB_2101010_PRE;
|
||||
break;
|
||||
case DRM_FORMAT_RGB565:
|
||||
cogl_format = COGL_PIXEL_FORMAT_RGB_565;
|
||||
break;
|
||||
default:
|
||||
g_set_error (error, G_IO_ERROR,
|
||||
G_IO_ERROR_FAILED,
|
||||
"Unsupported buffer format %d", dma_buf->drm_format);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
attribs[attr_idx++] = EGL_WIDTH;
|
||||
attribs[attr_idx++] = dma_buf->width;
|
||||
attribs[attr_idx++] = EGL_HEIGHT;
|
||||
attribs[attr_idx++] = dma_buf->height;
|
||||
attribs[attr_idx++] = EGL_LINUX_DRM_FOURCC_EXT;
|
||||
attribs[attr_idx++] = dma_buf->drm_format;
|
||||
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE0_FD_EXT;
|
||||
attribs[attr_idx++] = dma_buf->fds[0];
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT;
|
||||
attribs[attr_idx++] = dma_buf->offsets[0];
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE0_PITCH_EXT;
|
||||
attribs[attr_idx++] = dma_buf->strides[0];
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT;
|
||||
attribs[attr_idx++] = dma_buf->drm_modifier & 0xffffffff;
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT;
|
||||
attribs[attr_idx++] = dma_buf->drm_modifier >> 32;
|
||||
|
||||
if (dma_buf->fds[1] >= 0)
|
||||
for (n_planes = 0; n_planes < META_WAYLAND_DMA_BUF_MAX_FDS; n_planes++)
|
||||
{
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE1_FD_EXT;
|
||||
attribs[attr_idx++] = dma_buf->fds[1];
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE1_OFFSET_EXT;
|
||||
attribs[attr_idx++] = dma_buf->offsets[1];
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE1_PITCH_EXT;
|
||||
attribs[attr_idx++] = dma_buf->strides[1];
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT;
|
||||
attribs[attr_idx++] = dma_buf->drm_modifier & 0xffffffff;
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT;
|
||||
attribs[attr_idx++] = dma_buf->drm_modifier >> 32;
|
||||
if (dma_buf->fds[n_planes] < 0)
|
||||
break;
|
||||
|
||||
modifiers[n_planes] = dma_buf->drm_modifier;
|
||||
}
|
||||
|
||||
if (dma_buf->fds[2] >= 0)
|
||||
{
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE2_FD_EXT;
|
||||
attribs[attr_idx++] = dma_buf->fds[2];
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE2_OFFSET_EXT;
|
||||
attribs[attr_idx++] = dma_buf->offsets[2];
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE2_PITCH_EXT;
|
||||
attribs[attr_idx++] = dma_buf->strides[2];
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT;
|
||||
attribs[attr_idx++] = dma_buf->drm_modifier & 0xffffffff;
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT;
|
||||
attribs[attr_idx++] = dma_buf->drm_modifier >> 32;
|
||||
}
|
||||
|
||||
if (dma_buf->fds[3] >= 0)
|
||||
{
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE3_FD_EXT;
|
||||
attribs[attr_idx++] = dma_buf->fds[3];
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE3_OFFSET_EXT;
|
||||
attribs[attr_idx++] = dma_buf->offsets[3];
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE3_PITCH_EXT;
|
||||
attribs[attr_idx++] = dma_buf->strides[3];
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT;
|
||||
attribs[attr_idx++] = dma_buf->drm_modifier & 0xffffffff;
|
||||
attribs[attr_idx++] = EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT;
|
||||
attribs[attr_idx++] = dma_buf->drm_modifier >> 32;
|
||||
}
|
||||
|
||||
attribs[attr_idx++] = EGL_NONE;
|
||||
attribs[attr_idx++] = EGL_NONE;
|
||||
|
||||
/* The EXT_image_dma_buf_import spec states that EGL_NO_CONTEXT is to be used
|
||||
* in conjunction with the EGL_LINUX_DMA_BUF_EXT target. Similarly, the
|
||||
* native buffer is named in the attribs. */
|
||||
egl_image = meta_egl_create_image (egl, egl_display, EGL_NO_CONTEXT,
|
||||
EGL_LINUX_DMA_BUF_EXT, NULL, attribs,
|
||||
error);
|
||||
egl_image = meta_egl_create_dmabuf_image (egl,
|
||||
egl_display,
|
||||
dma_buf->width,
|
||||
dma_buf->height,
|
||||
dma_buf->drm_format,
|
||||
n_planes,
|
||||
dma_buf->fds,
|
||||
dma_buf->strides,
|
||||
dma_buf->offsets,
|
||||
modifiers,
|
||||
error);
|
||||
if (egl_image == EGL_NO_IMAGE_KHR)
|
||||
return FALSE;
|
||||
|
||||
|
@@ -65,19 +65,11 @@
|
||||
#endif
|
||||
|
||||
#define GSD_KEYBOARD_SCHEMA "org.gnome.settings-daemon.peripherals.keyboard"
|
||||
typedef enum
|
||||
{
|
||||
GSD_KEYBOARD_NUM_LOCK_STATE_UNKNOWN,
|
||||
GSD_KEYBOARD_NUM_LOCK_STATE_ON,
|
||||
GSD_KEYBOARD_NUM_LOCK_STATE_OFF
|
||||
} GsdKeyboardNumLockState;
|
||||
|
||||
G_DEFINE_TYPE (MetaWaylandKeyboard, meta_wayland_keyboard,
|
||||
META_TYPE_WAYLAND_INPUT_DEVICE)
|
||||
|
||||
static void meta_wayland_keyboard_update_xkb_state (MetaWaylandKeyboard *keyboard);
|
||||
static void meta_wayland_keyboard_set_numlock (MetaWaylandKeyboard *keyboard,
|
||||
gboolean numlock_state);
|
||||
static void notify_modifiers (MetaWaylandKeyboard *keyboard);
|
||||
static guint evdev_code (const ClutterKeyEvent *event);
|
||||
|
||||
@@ -404,110 +396,6 @@ notify_modifiers (MetaWaylandKeyboard *keyboard)
|
||||
xkb_state_serialize_mods (state, XKB_STATE_MODS_EFFECTIVE));
|
||||
}
|
||||
|
||||
static void
|
||||
numlock_set_xkb_state (MetaWaylandKeyboard *keyboard,
|
||||
GsdKeyboardNumLockState state)
|
||||
{
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
gboolean numlock_state;
|
||||
|
||||
if (state != GSD_KEYBOARD_NUM_LOCK_STATE_ON &&
|
||||
state != GSD_KEYBOARD_NUM_LOCK_STATE_OFF)
|
||||
return;
|
||||
|
||||
numlock_state = (state == GSD_KEYBOARD_NUM_LOCK_STATE_ON);
|
||||
meta_verbose ("set numlock state %s\n", (numlock_state ? "ON" : "OFF"));
|
||||
meta_backend_set_numlock (backend, numlock_state);
|
||||
meta_wayland_keyboard_set_numlock (keyboard, numlock_state);
|
||||
}
|
||||
|
||||
static void
|
||||
maybe_restore_numlock_state (MetaWaylandKeyboard *keyboard)
|
||||
{
|
||||
gboolean remember_numlock;
|
||||
|
||||
if (!keyboard->gsd_settings)
|
||||
return;
|
||||
|
||||
/* We are cheating for now, we use g-s-d settings... */
|
||||
remember_numlock = g_settings_get_boolean (keyboard->gsd_settings,
|
||||
"remember-numlock-state");
|
||||
|
||||
if (remember_numlock)
|
||||
{
|
||||
GsdKeyboardNumLockState state;
|
||||
|
||||
state = g_settings_get_enum (keyboard->gsd_settings, "numlock-state");
|
||||
numlock_set_xkb_state (keyboard, state);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
maybe_save_numlock_state (MetaWaylandKeyboard *keyboard)
|
||||
{
|
||||
#ifdef HAVE_NATIVE_BACKEND
|
||||
MetaWaylandXkbInfo *xkb_info = &keyboard->xkb_info;
|
||||
GsdKeyboardNumLockState numlock_state;
|
||||
int numlock_active;
|
||||
|
||||
if (!META_IS_BACKEND_NATIVE (meta_get_backend ()))
|
||||
return;
|
||||
|
||||
if (!xkb_info->state)
|
||||
return;
|
||||
|
||||
if (!keyboard->gsd_settings)
|
||||
return;
|
||||
|
||||
if (!g_settings_get_boolean (keyboard->gsd_settings, "remember-numlock-state"))
|
||||
return;
|
||||
|
||||
numlock_active = xkb_state_mod_name_is_active(xkb_info->state,
|
||||
"Mod2",
|
||||
XKB_STATE_MODS_LOCKED);
|
||||
switch (numlock_active)
|
||||
{
|
||||
case -1:
|
||||
numlock_state = GSD_KEYBOARD_NUM_LOCK_STATE_UNKNOWN;
|
||||
break;
|
||||
case 0:
|
||||
numlock_state = GSD_KEYBOARD_NUM_LOCK_STATE_OFF;
|
||||
break;
|
||||
default:
|
||||
numlock_state = GSD_KEYBOARD_NUM_LOCK_STATE_ON;
|
||||
break;
|
||||
}
|
||||
g_settings_set_enum (keyboard->gsd_settings, "numlock-state", numlock_state);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_keyboard_set_numlock (MetaWaylandKeyboard *keyboard,
|
||||
gboolean numlock_state)
|
||||
{
|
||||
MetaWaylandXkbInfo *xkb_info = &keyboard->xkb_info;
|
||||
xkb_mod_mask_t latched, locked, group, depressed;
|
||||
xkb_mod_mask_t numlock;
|
||||
|
||||
meta_verbose ("backend numlock state %s\n", (numlock_state ? "ON" : "OFF"));
|
||||
|
||||
latched = xkb_state_serialize_mods (xkb_info->state, XKB_STATE_MODS_LATCHED);
|
||||
locked = xkb_state_serialize_mods (xkb_info->state, XKB_STATE_MODS_LOCKED);
|
||||
group = xkb_state_serialize_layout (xkb_info->state, XKB_STATE_LAYOUT_EFFECTIVE);
|
||||
depressed = xkb_state_serialize_mods(xkb_info->state, XKB_STATE_DEPRESSED);
|
||||
numlock = (1 << xkb_keymap_mod_get_index(xkb_info->keymap, "Mod2"));
|
||||
|
||||
if (numlock_state == TRUE)
|
||||
locked |= numlock;
|
||||
else
|
||||
locked &= ~numlock;
|
||||
|
||||
xkb_state_update_mask (xkb_info->state, depressed, latched, locked, 0, 0, group);
|
||||
kbd_a11y_apply_mask (keyboard);
|
||||
|
||||
notify_modifiers (keyboard);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_keyboard_update_xkb_state (MetaWaylandKeyboard *keyboard)
|
||||
{
|
||||
@@ -615,16 +503,6 @@ notify_key_repeat (MetaWaylandKeyboard *keyboard)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
remember_numlock_state_changed (GSettings *settings,
|
||||
const char *key,
|
||||
gpointer data)
|
||||
{
|
||||
MetaWaylandKeyboard *keyboard = data;
|
||||
|
||||
maybe_save_numlock_state (keyboard);
|
||||
}
|
||||
|
||||
static void
|
||||
settings_changed (GSettings *settings,
|
||||
const char *key,
|
||||
@@ -678,24 +556,11 @@ void
|
||||
meta_wayland_keyboard_enable (MetaWaylandKeyboard *keyboard)
|
||||
{
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
GSettingsSchema *schema;
|
||||
|
||||
keyboard->settings = g_settings_new ("org.gnome.desktop.peripherals.keyboard");
|
||||
g_signal_connect (keyboard->settings, "changed",
|
||||
G_CALLBACK (settings_changed), keyboard);
|
||||
|
||||
/* We are cheating for now, we use g-s-d settings... Check if available */
|
||||
schema = g_settings_schema_source_lookup (g_settings_schema_source_get_default (),
|
||||
GSD_KEYBOARD_SCHEMA,
|
||||
TRUE);
|
||||
if (schema)
|
||||
{
|
||||
keyboard->gsd_settings = g_settings_new_full (schema, NULL, NULL);
|
||||
g_settings_schema_unref (schema);
|
||||
g_signal_connect (keyboard->gsd_settings, "changed::remember-numlock-state",
|
||||
G_CALLBACK (remember_numlock_state_changed), keyboard);
|
||||
}
|
||||
|
||||
g_signal_connect (backend, "keymap-changed",
|
||||
G_CALLBACK (on_keymap_changed), keyboard);
|
||||
g_signal_connect (backend, "keymap-layout-group-changed",
|
||||
@@ -705,8 +570,6 @@ meta_wayland_keyboard_enable (MetaWaylandKeyboard *keyboard)
|
||||
G_CALLBACK (on_kbd_a11y_mask_changed), keyboard);
|
||||
|
||||
meta_wayland_keyboard_take_keymap (keyboard, meta_backend_get_keymap (backend));
|
||||
|
||||
maybe_restore_numlock_state (keyboard);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -735,8 +598,6 @@ meta_wayland_keyboard_disable (MetaWaylandKeyboard *keyboard)
|
||||
wl_list_init (&keyboard->focus_resource_list);
|
||||
|
||||
g_clear_object (&keyboard->settings);
|
||||
if (keyboard->gsd_settings)
|
||||
g_object_unref (keyboard->gsd_settings);
|
||||
}
|
||||
|
||||
static guint
|
||||
@@ -802,8 +663,6 @@ meta_wayland_keyboard_handle_event (MetaWaylandKeyboard *keyboard,
|
||||
|
||||
if (keyboard->mods_changed != 0)
|
||||
{
|
||||
if (keyboard->mods_changed & XKB_STATE_MODS_LOCKED)
|
||||
maybe_save_numlock_state (keyboard);
|
||||
notify_modifiers (keyboard);
|
||||
keyboard->mods_changed = 0;
|
||||
}
|
||||
|
@@ -104,7 +104,6 @@ struct _MetaWaylandKeyboard
|
||||
MetaWaylandKeyboardGrab default_grab;
|
||||
|
||||
GSettings *settings;
|
||||
GSettings *gsd_settings;
|
||||
};
|
||||
|
||||
void meta_wayland_keyboard_enable (MetaWaylandKeyboard *keyboard);
|
||||
|
@@ -573,7 +573,9 @@ send_xdg_output_events (struct wl_resource *resource,
|
||||
MetaRectangle new_layout;
|
||||
MetaRectangle old_layout;
|
||||
MetaLogicalMonitor *old_logical_monitor;
|
||||
MetaMonitor *monitor;
|
||||
gboolean need_done;
|
||||
int version;
|
||||
|
||||
need_done = FALSE;
|
||||
old_logical_monitor = wayland_output->logical_monitor;
|
||||
@@ -600,6 +602,25 @@ send_xdg_output_events (struct wl_resource *resource,
|
||||
need_done = TRUE;
|
||||
}
|
||||
|
||||
version = wl_resource_get_version (resource);
|
||||
monitor = pick_main_monitor (logical_monitor);
|
||||
|
||||
if (need_all_events && version >= ZXDG_OUTPUT_V1_NAME_SINCE_VERSION)
|
||||
{
|
||||
const char *name;
|
||||
|
||||
name = meta_monitor_get_connector (monitor);
|
||||
zxdg_output_v1_send_name (resource, name);
|
||||
}
|
||||
|
||||
if (need_all_events && version >= ZXDG_OUTPUT_V1_DESCRIPTION_SINCE_VERSION)
|
||||
{
|
||||
const char *description;
|
||||
|
||||
description = meta_monitor_get_display_name (monitor);
|
||||
zxdg_output_v1_send_description (resource, description);
|
||||
}
|
||||
|
||||
if (need_all_events)
|
||||
{
|
||||
zxdg_output_v1_send_done (resource);
|
||||
|
@@ -49,7 +49,6 @@
|
||||
#include "backends/meta-backend-private.h"
|
||||
#include "backends/meta-cursor-renderer.h"
|
||||
#include "backends/meta-cursor-tracker-private.h"
|
||||
#include "backends/meta-cursor-tracker-private.h"
|
||||
#include "backends/meta-cursor.h"
|
||||
#include "clutter/clutter.h"
|
||||
#include "clutter/evdev/clutter-evdev.h"
|
||||
@@ -226,6 +225,14 @@ static void
|
||||
sync_focus_surface (MetaWaylandPointer *pointer)
|
||||
{
|
||||
MetaDisplay *display = meta_get_display ();
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
MetaCursorTracker *cursor_tracker = meta_backend_get_cursor_tracker (backend);
|
||||
|
||||
if (!meta_cursor_tracker_get_pointer_visible (cursor_tracker))
|
||||
{
|
||||
meta_wayland_pointer_set_focus (pointer, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (display->event_route)
|
||||
{
|
||||
@@ -473,6 +480,13 @@ meta_wayland_pointer_on_cursor_changed (MetaCursorTracker *cursor_tracker,
|
||||
meta_wayland_surface_update_outputs (pointer->cursor_surface);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_wayland_pointer_on_cursor_visibility_changed (MetaCursorTracker *cursor_tracker,
|
||||
MetaWaylandPointer *pointer)
|
||||
{
|
||||
sync_focus_surface (pointer);
|
||||
}
|
||||
|
||||
void
|
||||
meta_wayland_pointer_enable (MetaWaylandPointer *pointer)
|
||||
{
|
||||
@@ -493,6 +507,11 @@ meta_wayland_pointer_enable (MetaWaylandPointer *pointer)
|
||||
"cursor-changed",
|
||||
G_CALLBACK (meta_wayland_pointer_on_cursor_changed),
|
||||
pointer);
|
||||
|
||||
g_signal_connect (cursor_tracker,
|
||||
"visibility-changed",
|
||||
G_CALLBACK (meta_wayland_pointer_on_cursor_visibility_changed),
|
||||
pointer);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -505,6 +524,10 @@ meta_wayland_pointer_disable (MetaWaylandPointer *pointer)
|
||||
(gpointer) meta_wayland_pointer_on_cursor_changed,
|
||||
pointer);
|
||||
|
||||
g_signal_handlers_disconnect_by_func (cursor_tracker,
|
||||
meta_wayland_pointer_on_cursor_visibility_changed,
|
||||
pointer);
|
||||
|
||||
if (pointer->cursor_surface && pointer->cursor_surface_destroy_id)
|
||||
{
|
||||
g_signal_handler_disconnect (pointer->cursor_surface,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user