Compare commits
3 Commits
wip/matthi
...
matthiasc/
Author | SHA1 | Date | |
---|---|---|---|
|
24361d288f | ||
|
886f521fb5 | ||
|
ebbc60ffaa |
@@ -429,7 +429,7 @@ fi
|
|||||||
|
|
||||||
PKG_PROG_PKG_CONFIG
|
PKG_PROG_PKG_CONFIG
|
||||||
|
|
||||||
WAYLAND_DEPENDENCIES="wayland-client >= wayland_required_version wayland-protocols >= wayland_protocols_required_version xkbcommon >= 0.2.0 wayland-cursor >= wayland_required_version wayland-egl"
|
WAYLAND_DEPENDENCIES="wayland-client >= wayland_required_version wayland-protocols >= wayland_protocols_required_version xkbcommon >= 0.2.0 wayland-cursor >= wayland_required_version wayland-egl libcanberra"
|
||||||
if test "$enable_wayland_backend" = "maybe" ; then
|
if test "$enable_wayland_backend" = "maybe" ; then
|
||||||
AC_PATH_PROG([WAYLAND_SCANNER],[wayland-scanner],[no])
|
AC_PATH_PROG([WAYLAND_SCANNER],[wayland-scanner],[no])
|
||||||
PKG_CHECK_EXISTS($WAYLAND_DEPENDENCIES, [have_wayland_deps=yes], [have_wayland_deps=no])
|
PKG_CHECK_EXISTS($WAYLAND_DEPENDENCIES, [have_wayland_deps=yes], [have_wayland_deps=no])
|
||||||
|
@@ -27,7 +27,9 @@
|
|||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
#include "gdkintl.h"
|
||||||
#include "gdkwayland.h"
|
#include "gdkwayland.h"
|
||||||
|
#include "gdkprivate-wayland.h"
|
||||||
#include "gdkdisplay.h"
|
#include "gdkdisplay.h"
|
||||||
#include "gdkdisplay-wayland.h"
|
#include "gdkdisplay-wayland.h"
|
||||||
#include "gdkscreen.h"
|
#include "gdkscreen.h"
|
||||||
@@ -39,6 +41,8 @@
|
|||||||
#include "gdkglcontext-wayland.h"
|
#include "gdkglcontext-wayland.h"
|
||||||
#include "pointer-gestures-unstable-v1-client-protocol.h"
|
#include "pointer-gestures-unstable-v1-client-protocol.h"
|
||||||
|
|
||||||
|
#include <canberra.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:wayland_interaction
|
* SECTION:wayland_interaction
|
||||||
* @Short_description: Wayland backend-specific functions
|
* @Short_description: Wayland backend-specific functions
|
||||||
@@ -522,7 +526,25 @@ gdk_wayland_display_get_default_screen (GdkDisplay *display)
|
|||||||
static void
|
static void
|
||||||
gdk_wayland_display_beep (GdkDisplay *display)
|
gdk_wayland_display_beep (GdkDisplay *display)
|
||||||
{
|
{
|
||||||
|
ca_context *c;
|
||||||
|
ca_proplist *p;
|
||||||
|
|
||||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||||
|
|
||||||
|
c = gdk_wayland_screen_get_ca_context (gdk_display_get_default_screen (display));
|
||||||
|
if (!c)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ca_proplist_create (&p);
|
||||||
|
ca_proplist_sets (p, CA_PROP_EVENT_ID, "bell-window-system");
|
||||||
|
ca_proplist_sets (p, CA_PROP_EVENT_DESCRIPTION, _("Bell event"));
|
||||||
|
ca_proplist_sets (p, CA_PROP_CANBERRA_CACHE_CONTROL, "permanent");
|
||||||
|
|
||||||
|
ca_proplist_setf (p, CA_PROP_APPLICATION_PROCESS_ID, "%d", getpid ());
|
||||||
|
|
||||||
|
ca_context_play_full (c, 1, p, NULL, NULL);
|
||||||
|
|
||||||
|
ca_proplist_destroy (p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -36,6 +36,8 @@
|
|||||||
|
|
||||||
#include <xkbcommon/xkbcommon.h>
|
#include <xkbcommon/xkbcommon.h>
|
||||||
|
|
||||||
|
#include <canberra.h>
|
||||||
|
|
||||||
#include "gdkinternals.h"
|
#include "gdkinternals.h"
|
||||||
#include "wayland/gtk-primary-selection-client-protocol.h"
|
#include "wayland/gtk-primary-selection-client-protocol.h"
|
||||||
|
|
||||||
@@ -276,4 +278,6 @@ EGLSurface gdk_wayland_window_get_dummy_egl_surface (GdkWindow *window,
|
|||||||
void gdk_wayland_seat_set_global_cursor (GdkSeat *seat,
|
void gdk_wayland_seat_set_global_cursor (GdkSeat *seat,
|
||||||
GdkCursor *cursor);
|
GdkCursor *cursor);
|
||||||
|
|
||||||
|
ca_context *gdk_wayland_screen_get_ca_context (GdkScreen *screen);
|
||||||
|
|
||||||
#endif /* __GDK_PRIVATE_WAYLAND_H__ */
|
#endif /* __GDK_PRIVATE_WAYLAND_H__ */
|
||||||
|
@@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
#include "wm-button-layout-translation.h"
|
#include "wm-button-layout-translation.h"
|
||||||
|
|
||||||
|
#include "canberra.h"
|
||||||
|
|
||||||
typedef struct _GdkWaylandScreen GdkWaylandScreen;
|
typedef struct _GdkWaylandScreen GdkWaylandScreen;
|
||||||
typedef struct _GdkWaylandScreenClass GdkWaylandScreenClass;
|
typedef struct _GdkWaylandScreenClass GdkWaylandScreenClass;
|
||||||
|
|
||||||
@@ -70,6 +72,7 @@ struct _GdkWaylandScreen
|
|||||||
|
|
||||||
GHashTable *settings;
|
GHashTable *settings;
|
||||||
GsdXftSettings xft_settings;
|
GsdXftSettings xft_settings;
|
||||||
|
ca_context *ca_context;
|
||||||
|
|
||||||
guint32 shell_capabilities;
|
guint32 shell_capabilities;
|
||||||
};
|
};
|
||||||
@@ -159,6 +162,9 @@ gdk_wayland_screen_finalize (GObject *object)
|
|||||||
|
|
||||||
deinit_multihead (GDK_SCREEN (object));
|
deinit_multihead (GDK_SCREEN (object));
|
||||||
|
|
||||||
|
if (screen_wayland->ca_context)
|
||||||
|
ca_context_destroy (screen_wayland->ca_context);
|
||||||
|
|
||||||
g_hash_table_destroy (screen_wayland->settings);
|
g_hash_table_destroy (screen_wayland->settings);
|
||||||
|
|
||||||
G_OBJECT_CLASS (_gdk_wayland_screen_parent_class)->finalize (object);
|
G_OBJECT_CLASS (_gdk_wayland_screen_parent_class)->finalize (object);
|
||||||
@@ -595,6 +601,83 @@ find_translation_entry_by_setting (const gchar *setting)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ca_context *
|
||||||
|
gdk_wayland_screen_get_ca_context (GdkScreen *screen)
|
||||||
|
{
|
||||||
|
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
|
||||||
|
ca_context *c;
|
||||||
|
ca_proplist *p;
|
||||||
|
const char *name;
|
||||||
|
GSettings *settings;
|
||||||
|
|
||||||
|
if (screen_wayland->ca_context)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
if (ca_context_create (&c) != CA_SUCCESS)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (ca_proplist_create (&p) != CA_SUCCESS)
|
||||||
|
{
|
||||||
|
ca_context_destroy (c);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
name = g_get_application_name ();
|
||||||
|
if (name)
|
||||||
|
ca_proplist_sets (p, CA_PROP_APPLICATION_NAME, name);
|
||||||
|
|
||||||
|
settings = g_hash_table_lookup (screen_wayland->settings, "org.gnome.desktop.sound");
|
||||||
|
|
||||||
|
if (settings)
|
||||||
|
{
|
||||||
|
char *theme_name;
|
||||||
|
gboolean event_sounds;
|
||||||
|
|
||||||
|
theme_name = g_settings_get_string (settings, "theme-name");
|
||||||
|
event_sounds = g_settings_get_boolean (settings, "event-sounds");
|
||||||
|
|
||||||
|
ca_proplist_sets (p, CA_PROP_CANBERRA_XDG_THEME_NAME, theme_name);
|
||||||
|
ca_proplist_sets (p, CA_PROP_CANBERRA_ENABLE, event_sounds ? "1" : "0");
|
||||||
|
|
||||||
|
g_free (theme_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
ca_context_change_props_full (c, p);
|
||||||
|
ca_proplist_destroy (p);
|
||||||
|
|
||||||
|
screen_wayland->ca_context = c;
|
||||||
|
|
||||||
|
out:
|
||||||
|
return screen_wayland->ca_context;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
update_sound_settings (GSettings *settings,
|
||||||
|
const char *key,
|
||||||
|
GdkScreen *screen)
|
||||||
|
{
|
||||||
|
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
|
||||||
|
|
||||||
|
if (screen_wayland->ca_context == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (strcmp (key, "theme-name") == 0)
|
||||||
|
{
|
||||||
|
gchar *theme_name;
|
||||||
|
|
||||||
|
theme_name = g_settings_get_string (settings, key);
|
||||||
|
ca_context_change_props (screen_wayland->ca_context, CA_PROP_CANBERRA_XDG_THEME_NAME, theme_name, NULL);
|
||||||
|
g_free (theme_name);
|
||||||
|
}
|
||||||
|
else if (strcmp (key, "event-sounds") == 0)
|
||||||
|
{
|
||||||
|
gboolean event_sounds;
|
||||||
|
|
||||||
|
event_sounds = g_settings_get_boolean (settings, key);
|
||||||
|
ca_context_change_props (screen_wayland->ca_context, CA_PROP_CANBERRA_ENABLE, event_sounds ? "1" : "0", NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
settings_changed (GSettings *settings,
|
settings_changed (GSettings *settings,
|
||||||
const gchar *key,
|
const gchar *key,
|
||||||
@@ -606,6 +689,9 @@ settings_changed (GSettings *settings,
|
|||||||
|
|
||||||
if (entry != NULL)
|
if (entry != NULL)
|
||||||
{
|
{
|
||||||
|
if (strcmp (entry->schema, "org.gnome.desktop.sound") == 0)
|
||||||
|
update_sound_settings (settings, key, screen);
|
||||||
|
|
||||||
if (entry->type != G_TYPE_NONE)
|
if (entry->type != G_TYPE_NONE)
|
||||||
notify_setting (screen, entry->setting);
|
notify_setting (screen, entry->setting);
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user