[gtk+] wayland: Formatting fixes
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] wayland: Formatting fixes
- Date: Sat, 28 Feb 2015 05:58:19 +0000 (UTC)
commit 94c5d691df28ec9315064e1ba2833288256a86c4
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Feb 27 22:28:28 2015 -0500
wayland: Formatting fixes
gdk/wayland/gdkapplaunchcontext-wayland.c | 8 +-
gdk/wayland/gdkcursor-wayland.c | 5 +-
gdk/wayland/gdkdevice-wayland.c | 161 ++++++++++++++---------------
gdk/wayland/gdkdisplay-wayland.c | 147 ++++++++++++++------------
gdk/wayland/gdkdisplay-wayland.h | 6 +-
gdk/wayland/gdkeventsource.c | 14 ++-
gdk/wayland/gdkglcontext-wayland.c | 7 +-
gdk/wayland/gdkkeys-wayland.c | 16 ++--
gdk/wayland/gdkprivate-wayland.h | 4 +-
gdk/wayland/gdkscreen-wayland.c | 96 ++++++++++--------
gdk/wayland/gdkselection-wayland.c | 62 ++++++-----
gdk/wayland/gdkwayland.h | 2 +-
gdk/wayland/gdkwaylandselection.h | 2 +-
gdk/wayland/gdkwindow-wayland.c | 117 ++++++++-------------
14 files changed, 325 insertions(+), 322 deletions(-)
---
diff --git a/gdk/wayland/gdkapplaunchcontext-wayland.c b/gdk/wayland/gdkapplaunchcontext-wayland.c
index 6991164..b69cc31 100644
--- a/gdk/wayland/gdkapplaunchcontext-wayland.c
+++ b/gdk/wayland/gdkapplaunchcontext-wayland.c
@@ -32,15 +32,15 @@
static char *
gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
- GAppInfo *info,
- GList *files)
+ GAppInfo *info,
+ GList *files)
{
return NULL;
}
static void
-gdk_wayland_app_launch_context_launch_failed (GAppLaunchContext *context,
- const char *startup_notify_id)
+gdk_wayland_app_launch_context_launch_failed (GAppLaunchContext *context,
+ const char *startup_notify_id)
{
}
diff --git a/gdk/wayland/gdkcursor-wayland.c b/gdk/wayland/gdkcursor-wayland.c
index c350b03..7691db8 100644
--- a/gdk/wayland/gdkcursor-wayland.c
+++ b/gdk/wayland/gdkcursor-wayland.c
@@ -19,7 +19,7 @@
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
@@ -83,7 +83,8 @@ _gdk_wayland_display_finalize_cursors (GdkWaylandDisplay *display)
}
static gboolean
-set_cursor_from_theme (GdkWaylandCursor *cursor, struct wl_cursor_theme *theme)
+set_cursor_from_theme (GdkWaylandCursor *cursor,
+ struct wl_cursor_theme *theme)
{
struct wl_cursor *c;
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index b176450..52aca1b 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -253,11 +253,7 @@ gdk_wayland_device_set_window_cursor (GdkDevice *device,
* the default cursor
*/
if (!cursor)
- {
- /* FIXME: Is this the best sensible default ? */
- cursor = _gdk_wayland_display_get_cursor_for_type (device->display,
- GDK_LEFT_PTR);
- }
+ cursor = _gdk_wayland_display_get_cursor_for_type (device->display, GDK_LEFT_PTR);
if (cursor == wd->cursor)
return;
@@ -282,8 +278,10 @@ gdk_wayland_device_warp (GdkDevice *device,
static void
get_coordinates (GdkWaylandDeviceData *data,
- double *x, double *y,
- double *x_root, double *y_root)
+ double *x,
+ double *y,
+ double *x_root,
+ double *y_root)
{
int root_x, root_y;
@@ -357,7 +355,6 @@ gdk_wayland_device_grab (GdkDevice *device,
else
{
/* Device is a pointer */
-
if (wayland_device->pointer_grab_window != NULL &&
time_ != 0 && wayland_device->pointer_grab_time > time_)
{
@@ -482,7 +479,7 @@ gdk_wayland_device_init (GdkWaylandDevice *device_core)
* gdk_wayland_device_get_wl_seat:
* @device: (type GdkWaylandDevice): a #GdkDevice
*
- * Returns the Wayland wl_seat of a #GdkDevice
+ * Returns the Wayland wl_seat of a #GdkDevice.
*
* Returns: (transfer none): a Wayland wl_seat
*
@@ -491,7 +488,7 @@ gdk_wayland_device_init (GdkWaylandDevice *device_core)
struct wl_seat *
gdk_wayland_device_get_wl_seat (GdkDevice *device)
{
- g_return_val_if_fail(GDK_IS_WAYLAND_DEVICE (device), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (device), NULL);
return GDK_WAYLAND_DEVICE (device)->device->wl_seat;
}
@@ -500,7 +497,7 @@ gdk_wayland_device_get_wl_seat (GdkDevice *device)
* gdk_wayland_device_get_wl_pointer:
* @device: (type GdkWaylandDevice): a #GdkDevice
*
- * Returns the Wayland wl_pointer of a #GdkDevice
+ * Returns the Wayland wl_pointer of a #GdkDevice.
*
* Returns: (transfer none): a Wayland wl_pointer
*
@@ -509,7 +506,7 @@ gdk_wayland_device_get_wl_seat (GdkDevice *device)
struct wl_pointer *
gdk_wayland_device_get_wl_pointer (GdkDevice *device)
{
- g_return_val_if_fail(GDK_IS_WAYLAND_DEVICE (device), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (device), NULL);
return GDK_WAYLAND_DEVICE (device)->device->wl_pointer;
}
@@ -518,7 +515,7 @@ gdk_wayland_device_get_wl_pointer (GdkDevice *device)
* gdk_wayland_device_get_wl_keyboard:
* @device: (type GdkWaylandDevice): a #GdkDevice
*
- * Returns the Wayland wl_keyboard of a #GdkDevice
+ * Returns the Wayland wl_keyboard of a #GdkDevice.
*
* Returns: (transfer none): a Wayland wl_keyboard
*
@@ -527,7 +524,7 @@ gdk_wayland_device_get_wl_pointer (GdkDevice *device)
struct wl_keyboard *
gdk_wayland_device_get_wl_keyboard (GdkDevice *device)
{
- g_return_val_if_fail(GDK_IS_WAYLAND_DEVICE (device), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (device), NULL);
return GDK_WAYLAND_DEVICE (device)->device->wl_keyboard;
}
@@ -735,6 +732,7 @@ pointer_handle_enter (void *data,
if (!surface)
return;
+
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
return;
@@ -781,13 +779,14 @@ pointer_handle_leave (void *data,
{
GdkWaylandDeviceData *device = data;
GdkEvent *event;
- GdkWaylandDisplay *wayland_display =
- GDK_WAYLAND_DISPLAY (device->display);
+ GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (device->display);
if (!surface)
return;
+
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
return;
+
if (!device->pointer_focus)
return;
@@ -818,7 +817,7 @@ pointer_handle_leave (void *data,
g_message ("leave, device %p surface %p",
device, device->pointer_focus));
- g_object_unref(device->pointer_focus);
+ g_object_unref (device->pointer_focus);
if (device->cursor)
gdk_wayland_device_stop_window_cursor_animation (device);
@@ -881,25 +880,24 @@ pointer_handle_button (void *data,
GdkEvent *event;
uint32_t modifier;
int gdk_button;
- GdkWaylandDisplay *wayland_display =
- GDK_WAYLAND_DISPLAY (device->display);
if (!device->pointer_focus)
return;
- _gdk_wayland_display_update_serial (wayland_display, serial);
+ _gdk_wayland_display_update_serial (display, serial);
- switch (button) {
- case 273:
- gdk_button = 3;
- break;
- case 274:
- gdk_button = 2;
- break;
- default:
- gdk_button = button - 271;
- break;
- }
+ switch (button)
+ {
+ case 273:
+ gdk_button = 3;
+ break;
+ case 274:
+ gdk_button = 2;
+ break;
+ default:
+ gdk_button = button - 271;
+ break;
+ }
device->time = time;
if (state)
@@ -951,18 +949,19 @@ pointer_handle_axis (void *data,
return;
/* get the delta and convert it into the expected range */
- switch (axis) {
- case WL_POINTER_AXIS_VERTICAL_SCROLL:
- delta_x = 0;
- delta_y = wl_fixed_to_double (value) / 10.0;
- break;
- case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
- delta_x = wl_fixed_to_double (value) / 10.0;
- delta_y = 0;
- break;
- default:
- g_return_if_reached ();
- }
+ switch (axis)
+ {
+ case WL_POINTER_AXIS_VERTICAL_SCROLL:
+ delta_x = 0;
+ delta_y = wl_fixed_to_double (value) / 10.0;
+ break;
+ case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
+ delta_x = wl_fixed_to_double (value) / 10.0;
+ delta_y = 0;
+ break;
+ default:
+ g_return_if_reached ();
+ }
device->time = time;
event = gdk_event_new (GDK_SCROLL);
@@ -1014,18 +1013,18 @@ keyboard_handle_enter (void *data,
{
GdkWaylandDeviceData *device = data;
GdkEvent *event;
- GdkWaylandDisplay *wayland_display =
- GDK_WAYLAND_DISPLAY (device->display);
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
if (!surface)
return;
+
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
return;
- _gdk_wayland_display_update_serial (wayland_display, serial);
+ _gdk_wayland_display_update_serial (display, serial);
- device->keyboard_focus = wl_surface_get_user_data(surface);
- g_object_ref(device->keyboard_focus);
+ device->keyboard_focus = wl_surface_get_user_data (surface);
+ g_object_ref (device->keyboard_focus);
event = gdk_event_new (GDK_FOCUS_CHANGE);
event->focus_change.window = g_object_ref (device->keyboard_focus);
@@ -1049,17 +1048,18 @@ keyboard_handle_leave (void *data,
{
GdkWaylandDeviceData *device = data;
GdkEvent *event;
- GdkWaylandDisplay *wayland_display =
- GDK_WAYLAND_DISPLAY (device->display);
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
if (!surface)
return;
+
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
return;
+
if (!device->keyboard_focus)
return;
- _gdk_wayland_display_update_serial (wayland_display, serial);
+ _gdk_wayland_display_update_serial (display, serial);
event = gdk_event_new (GDK_FOCUS_CHANGE);
event->focus_change.window = g_object_ref (device->keyboard_focus);
@@ -1068,7 +1068,7 @@ keyboard_handle_leave (void *data,
gdk_event_set_device (event, device->master_keyboard);
gdk_event_set_source_device (event, device->keyboard);
- g_object_unref(device->keyboard_focus);
+ g_object_unref (device->keyboard_focus);
device->keyboard_focus = NULL;
GDK_NOTE (EVENTS,
@@ -1078,8 +1078,7 @@ keyboard_handle_leave (void *data,
_gdk_wayland_display_deliver_event (device->display, event);
}
-static gboolean
-keyboard_repeat (gpointer data);
+static gboolean keyboard_repeat (gpointer data);
static void
translate_keyboard_string (GdkEventKey *event)
@@ -1100,11 +1099,11 @@ translate_keyboard_string (GdkEventKey *event)
gsize bytes_written;
gint len;
- /* Apply the control key - Taken from Xlib
- */
+ /* Apply the control key - Taken from Xlib */
if (event->state & GDK_CONTROL_MASK)
{
- if ((c >= '@' && c < '\177') || c == ' ') c &= 0x1F;
+ if ((c >= '@' && c < '\177') || c == ' ')
+ c &= 0x1F;
else if (c == '2')
{
event->string = g_memdup ("\0\0", 2);
@@ -1112,9 +1111,12 @@ translate_keyboard_string (GdkEventKey *event)
buf[0] = '\0';
return;
}
- else if (c >= '3' && c <= '7') c -= ('3' - '\033');
- else if (c == '8') c = '\177';
- else if (c == '/') c = '_' & 0x1F;
+ else if (c >= '3' && c <= '7')
+ c -= ('3' - '\033');
+ else if (c == '8')
+ c = '\177';
+ else if (c == '/')
+ c = '_' & 0x1F;
}
len = g_unichar_to_utf8 (c, buf);
@@ -1277,7 +1279,6 @@ deliver_key_event (GdkWaylandDeviceData *device,
g_source_remove (device->repeat_timer);
device->repeat_timer = 0;
}
-
device->repeat_timer =
gdk_threads_add_timeout (delay, keyboard_repeat, device);
g_source_set_name_by_id (device->repeat_timer, "[gtk+] keyboard_repeat");
@@ -1310,14 +1311,13 @@ keyboard_handle_key (void *data,
uint32_t state_w)
{
GdkWaylandDeviceData *device = data;
- GdkWaylandDisplay *wayland_display =
- GDK_WAYLAND_DISPLAY (device->display);
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
if (!device->keyboard_focus)
return;
device->repeat_count = 0;
- _gdk_wayland_display_update_serial (wayland_display, serial);
+ _gdk_wayland_display_update_serial (display, serial);
deliver_key_event (data, time, key + 8, state_w);
}
@@ -1439,12 +1439,11 @@ touch_handle_down (void *data,
wl_fixed_t y)
{
GdkWaylandDeviceData *device = data;
- GdkWaylandDisplay *wayland_display =
- GDK_WAYLAND_DISPLAY (device->display);
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
GdkWaylandTouchData *touch;
GdkEvent *event;
- _gdk_wayland_display_update_serial (wayland_display, serial);
+ _gdk_wayland_display_update_serial (display, serial);
touch = gdk_wayland_device_add_touch (device, id, wl_surface);
touch->x = wl_fixed_to_double (x);
@@ -1467,12 +1466,11 @@ touch_handle_up (void *data,
int32_t id)
{
GdkWaylandDeviceData *device = data;
- GdkWaylandDisplay *wayland_display =
- GDK_WAYLAND_DISPLAY (device->display);
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
GdkWaylandTouchData *touch;
GdkEvent *event;
- _gdk_wayland_display_update_serial (wayland_display, serial);
+ _gdk_wayland_display_update_serial (display, serial);
touch = gdk_wayland_device_get_touch (device, id);
event = _create_touch_event (device, touch, GDK_TOUCH_END, time);
@@ -1568,8 +1566,7 @@ seat_handle_capabilities (void *data,
enum wl_seat_capability caps)
{
GdkWaylandDeviceData *device = data;
- GdkWaylandDeviceManager *device_manager =
- GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
+ GdkWaylandDeviceManager *device_manager = GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
if ((caps & WL_SEAT_CAPABILITY_POINTER) && !device->wl_pointer)
{
@@ -1689,9 +1686,9 @@ seat_handle_capabilities (void *data,
}
static void
-seat_handle_name (void *data,
- struct wl_seat *seat,
- const char *name)
+seat_handle_name (void *data,
+ struct wl_seat *seat,
+ const char *name)
{
/* We don't care about the name. */
}
@@ -1704,8 +1701,7 @@ static const struct wl_seat_listener seat_listener = {
static void
init_devices (GdkWaylandDeviceData *device)
{
- GdkWaylandDeviceManager *device_manager =
- GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
+ GdkWaylandDeviceManager *device_manager = GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
/* pointer */
device->master_pointer = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
@@ -1832,7 +1828,7 @@ gdk_wayland_device_manager_list_devices (GdkDeviceManager *device_manager,
GdkWaylandDeviceManager *wayland_device_manager;
GList *devices = NULL, *l;
- wayland_device_manager = (GdkWaylandDeviceManager *) device_manager;
+ wayland_device_manager = GDK_WAYLAND_DEVICE_MANAGER (device_manager);
for (l = wayland_device_manager->devices; l; l = l->next)
{
@@ -1849,7 +1845,7 @@ gdk_wayland_device_manager_get_client_pointer (GdkDeviceManager *device_manager)
GdkWaylandDeviceManager *wayland_device_manager;
GList *l;
- wayland_device_manager = (GdkWaylandDeviceManager *) device_manager;
+ wayland_device_manager = GDK_WAYLAND_DEVICE_MANAGER (device_manager);
/* Find the first master pointer device */
for (l = wayland_device_manager->devices; l != NULL; l = l->next)
@@ -1943,6 +1939,7 @@ gdk_wayland_device_unset_touch_grab (GdkDevice *gdk_device,
GdkWaylandDeviceData *device;
g_return_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device));
+
device = GDK_WAYLAND_DEVICE (gdk_device)->device;
gdk_wayland_device_remove_touch (device, GDK_EVENT_SEQUENCE_TO_SLOT (sequence));
@@ -1953,12 +1950,9 @@ gdk_wayland_device_unset_touch_grab (GdkDevice *gdk_device,
struct wl_data_device *
gdk_wayland_device_get_data_device (GdkDevice *gdk_device)
{
- GdkWaylandDeviceData *device;
-
g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device), NULL);
- device = GDK_WAYLAND_DEVICE (gdk_device)->device;
- return device->data_device;
+ return GDK_WAYLAND_DEVICE (gdk_device)->device->data_device;
}
void
@@ -1969,6 +1963,7 @@ gdk_wayland_device_set_selection (GdkDevice *gdk_device,
GdkWaylandDisplay *display_wayland;
g_return_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device));
+
device = GDK_WAYLAND_DEVICE (gdk_device)->device;
display_wayland = GDK_WAYLAND_DISPLAY (gdk_device_get_display (gdk_device));
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index 46c3cc3..03ee38d 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -140,55 +140,71 @@ static const struct xdg_shell_listener xdg_shell_listener = {
};
static void
-gdk_registry_handle_global(void *data, struct wl_registry *registry, uint32_t id,
- const char *interface, uint32_t version)
+gdk_registry_handle_global (void *data,
+ struct wl_registry *registry,
+ uint32_t id,
+ const char *interface,
+ uint32_t version)
{
GdkWaylandDisplay *display_wayland = data;
GdkDisplay *gdk_display = GDK_DISPLAY_OBJECT (data);
struct wl_seat *seat;
struct wl_output *output;
- if (strcmp(interface, "wl_compositor") == 0) {
- display_wayland->compositor =
- wl_registry_bind(display_wayland->wl_registry, id, &wl_compositor_interface, MIN (version, 3));
- display_wayland->compositor_version = MIN (version, 3);
- } else if (strcmp(interface, "wl_shm") == 0) {
- display_wayland->shm =
- wl_registry_bind(display_wayland->wl_registry, id, &wl_shm_interface, 1);
-
- /* SHM interface is prerequisite */
- _gdk_wayland_display_load_cursor_theme(display_wayland);
- } else if (strcmp(interface, "xdg_shell") == 0) {
- display_wayland->xdg_shell =
- wl_registry_bind(display_wayland->wl_registry, id, &xdg_shell_interface, 1);
- xdg_shell_use_unstable_version(display_wayland->xdg_shell, XDG_SHELL_VERSION_CURRENT);
- xdg_shell_add_listener(display_wayland->xdg_shell, &xdg_shell_listener, display_wayland);
- } else if (strcmp(interface, "gtk_shell") == 0) {
- display_wayland->gtk_shell =
- wl_registry_bind(display_wayland->wl_registry, id, >k_shell_interface, 1);
- _gdk_wayland_screen_set_has_gtk_shell (display_wayland->screen);
- } else if (strcmp(interface, "wl_output") == 0) {
- output =
- wl_registry_bind(display_wayland->wl_registry, id, &wl_output_interface, MIN (version, 2));
- _gdk_wayland_screen_add_output(display_wayland->screen, id, output, MIN (version, 2));
- } else if (strcmp(interface, "wl_seat") == 0) {
- seat = wl_registry_bind(display_wayland->wl_registry, id, &wl_seat_interface, MIN (version, 4));
- _gdk_wayland_device_manager_add_seat (gdk_display->device_manager, id, seat);
- } else if (strcmp(interface, "wl_data_device_manager") == 0) {
+ if (strcmp (interface, "wl_compositor") == 0)
+ {
+ display_wayland->compositor =
+ wl_registry_bind (display_wayland->wl_registry, id, &wl_compositor_interface, MIN (version, 3));
+ display_wayland->compositor_version = MIN (version, 3);
+ }
+ else if (strcmp (interface, "wl_shm") == 0)
+ {
+ display_wayland->shm =
+ wl_registry_bind (display_wayland->wl_registry, id, &wl_shm_interface, 1);
+
+ /* SHM interface is prerequisite */
+ _gdk_wayland_display_load_cursor_theme (display_wayland);
+ }
+ else if (strcmp (interface, "xdg_shell") == 0)
+ {
+ display_wayland->xdg_shell =
+ wl_registry_bind (display_wayland->wl_registry, id, &xdg_shell_interface, 1);
+ xdg_shell_use_unstable_version (display_wayland->xdg_shell, XDG_SHELL_VERSION_CURRENT);
+ xdg_shell_add_listener (display_wayland->xdg_shell, &xdg_shell_listener, display_wayland);
+ }
+ else if (strcmp (interface, "gtk_shell") == 0)
+ {
+ display_wayland->gtk_shell =
+ wl_registry_bind (display_wayland->wl_registry, id, >k_shell_interface, 1);
+ _gdk_wayland_screen_set_has_gtk_shell (display_wayland->screen);
+ }
+ else if (strcmp (interface, "wl_output") == 0)
+ {
+ output =
+ wl_registry_bind (display_wayland->wl_registry, id, &wl_output_interface, MIN (version, 2));
+ _gdk_wayland_screen_add_output (display_wayland->screen, id, output, MIN (version, 2));
+ }
+ else if (strcmp (interface, "wl_seat") == 0)
+ {
+ seat = wl_registry_bind (display_wayland->wl_registry, id, &wl_seat_interface, MIN (version, 4));
+ _gdk_wayland_device_manager_add_seat (gdk_display->device_manager, id, seat);
+ }
+ else if (strcmp (interface, "wl_data_device_manager") == 0)
+ {
display_wayland->data_device_manager =
- wl_registry_bind(display_wayland->wl_registry, id,
- &wl_data_device_manager_interface, 1);
- } else if (strcmp (interface, "wl_subcompositor") == 0) {
- display_wayland->subcompositor =
- wl_registry_bind (display_wayland->wl_registry, id,
- &wl_subcompositor_interface, 1);
- }
+ wl_registry_bind (display_wayland->wl_registry, id, &wl_data_device_manager_interface, 1);
+ }
+ else if (strcmp (interface, "wl_subcompositor") == 0)
+ {
+ display_wayland->subcompositor =
+ wl_registry_bind (display_wayland->wl_registry, id, &wl_subcompositor_interface, 1);
+ }
}
static void
-gdk_registry_handle_global_remove(void *data,
- struct wl_registry *registry,
- uint32_t id)
+gdk_registry_handle_global_remove (void *data,
+ struct wl_registry *registry,
+ uint32_t id)
{
GdkWaylandDisplay *display_wayland = data;
GdkDisplay *display = GDK_DISPLAY (display_wayland);
@@ -205,7 +221,7 @@ static const struct wl_registry_listener registry_listener = {
};
static void
-log_handler(const char *format, va_list args)
+log_handler (const char *format, va_list args)
{
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
}
@@ -224,9 +240,9 @@ _gdk_wayland_display_open (const gchar *display_name)
if (g_getenv ("XDG_RUNTIME_DIR") == NULL)
return NULL;
- wl_log_set_handler_client(log_handler);
+ wl_log_set_handler_client (log_handler);
- wl_display = wl_display_connect(display_name);
+ wl_display = wl_display_connect (display_name);
if (!wl_display)
return NULL;
@@ -239,8 +255,8 @@ _gdk_wayland_display_open (const gchar *display_name)
display_wayland->event_source = _gdk_wayland_display_event_source_new (display);
_gdk_wayland_display_init_cursors (display_wayland);
- display_wayland->wl_registry = wl_display_get_registry(display_wayland->wl_display);
- wl_registry_add_listener(display_wayland->wl_registry, ®istry_listener, display_wayland);
+ display_wayland->wl_registry = wl_display_get_registry (display_wayland->wl_display);
+ wl_registry_add_listener (display_wayland->wl_registry, ®istry_listener, display_wayland);
/* Wait until the dust has settled during init... */
wl_display_roundtrip (display_wayland->wl_display);
@@ -326,7 +342,7 @@ gdk_wayland_display_sync (GdkDisplay *display)
display_wayland = GDK_WAYLAND_DISPLAY (display);
- wl_display_roundtrip(display_wayland->wl_display);
+ wl_display_roundtrip (display_wayland->wl_display);
}
static void
@@ -335,7 +351,7 @@ gdk_wayland_display_flush (GdkDisplay *display)
g_return_if_fail (GDK_IS_DISPLAY (display));
if (!display->closed)
- wl_display_flush(GDK_WAYLAND_DISPLAY (display)->wl_display);
+ wl_display_flush (GDK_WAYLAND_DISPLAY (display)->wl_display);
}
static gboolean
@@ -485,7 +501,7 @@ gdk_wayland_display_pop_error_trap (GdkDisplay *display,
}
static void
-gdk_wayland_display_class_init (GdkWaylandDisplayClass * class)
+gdk_wayland_display_class_init (GdkWaylandDisplayClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GdkDisplayClass *display_class = GDK_DISPLAY_CLASS (class);
@@ -591,8 +607,7 @@ _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *wayland_display)
else
name = "default";
- gdk_wayland_display_set_cursor_theme (GDK_DISPLAY (wayland_display),
- name, size);
+ gdk_wayland_display_set_cursor_theme (GDK_DISPLAY (wayland_display), name, size);
g_value_unset (&v);
}
@@ -610,30 +625,28 @@ _gdk_wayland_display_update_serial (GdkWaylandDisplay *wayland_display,
}
/**
- * gdk_wayland_display_get_wl_display
+ * gdk_wayland_display_get_wl_display:
* @display: (type GdkWaylandDisplay): a #GdkDisplay
*
- * Returns the Wayland wl_display of a #GdkDisplay
+ * Returns the Wayland wl_display of a #GdkDisplay.
*
* Returns: (transfer none): a Wayland wl_display
*
* Since: 3.8
*/
struct wl_display *
-gdk_wayland_display_get_wl_display(GdkDisplay *display)
+gdk_wayland_display_get_wl_display (GdkDisplay *display)
{
- GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
-
- g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY(display), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), NULL);
- return wayland_display->wl_display;
+ return GDK_WAYLAND_DISPLAY (display)->wl_display;
}
/**
- * gdk_wayland_display_get_wl_compositor
+ * gdk_wayland_display_get_wl_compositor:
* @display: (type GdkWaylandDisplay): a #GdkDisplay
*
- * Returns the Wayland global singleton compositor of a #GdkDisplay
+ * Returns the Wayland global singleton compositor of a #GdkDisplay.
*
* Returns: (transfer none): a Wayland wl_compositor
*
@@ -642,18 +655,16 @@ gdk_wayland_display_get_wl_display(GdkDisplay *display)
struct wl_compositor *
gdk_wayland_display_get_wl_compositor (GdkDisplay *display)
{
- GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
+ g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), NULL);
- g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY(display), NULL);
-
- return wayland_display->compositor;
+ return GDK_WAYLAND_DISPLAY (display)->compositor;
}
/**
- * gdk_wayland_display_get_xdg_shell
+ * gdk_wayland_display_get_xdg_shell:
* @display: (type GdkWaylandDisplay): a #GdkDisplay
*
- * Returns the Wayland global singleton shell of a #GdkDisplay
+ * Returns the Wayland global singleton shell of a #GdkDisplay.
*
* Returns: (transfer none): a Wayland xdg_shell
*
@@ -662,11 +673,9 @@ gdk_wayland_display_get_wl_compositor (GdkDisplay *display)
struct xdg_shell *
gdk_wayland_display_get_xdg_shell (GdkDisplay *display)
{
- GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
-
- g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY(display), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), NULL);
- return wayland_display->xdg_shell;
+ return GDK_WAYLAND_DISPLAY (display)->xdg_shell;
}
static const cairo_user_data_key_t gdk_wayland_cairo_key;
@@ -737,7 +746,7 @@ create_shm_pool (struct wl_shm *shm,
return NULL;
}
- pool = wl_shm_create_pool(shm, fd, size);
+ pool = wl_shm_create_pool (shm, fd, size);
close (fd);
diff --git a/gdk/wayland/gdkdisplay-wayland.h b/gdk/wayland/gdkdisplay-wayland.h
index 3bad519..48de6f9 100644
--- a/gdk/wayland/gdkdisplay-wayland.h
+++ b/gdk/wayland/gdkdisplay-wayland.h
@@ -1,7 +1,7 @@
/*
* gdkdisplay-wayland.h
- *
- * Copyright 2001 Sun Microsystems Inc.
+ *
+ * Copyright 2001 Sun Microsystems Inc.
*
* Erwann Chenede <erwann chenede sun com>
*
@@ -99,4 +99,4 @@ struct _GdkWaylandDisplayClass
G_END_DECLS
-#endif /* __GDK_WAYLAND_DISPLAY__ */
+#endif /* __GDK_WAYLAND_DISPLAY__ */
diff --git a/gdk/wayland/gdkeventsource.c b/gdk/wayland/gdkeventsource.c
index d675ce9..dcd10a1 100644
--- a/gdk/wayland/gdkeventsource.c
+++ b/gdk/wayland/gdkeventsource.c
@@ -33,7 +33,8 @@ typedef struct _GdkWaylandEventSource {
static GList *event_sources = NULL;
static gboolean
-gdk_event_source_prepare(GSource *base, gint *timeout)
+gdk_event_source_prepare (GSource *base,
+ gint *timeout)
{
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
GdkWaylandDisplay *display = (GdkWaylandDisplay *) source->display;
@@ -60,7 +61,7 @@ gdk_event_source_prepare(GSource *base, gint *timeout)
}
static gboolean
-gdk_event_source_check(GSource *base)
+gdk_event_source_check (GSource *base)
{
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
@@ -72,9 +73,9 @@ gdk_event_source_check(GSource *base)
}
static gboolean
-gdk_event_source_dispatch(GSource *base,
- GSourceFunc callback,
- gpointer data)
+gdk_event_source_dispatch (GSource *base,
+ GSourceFunc callback,
+ gpointer data)
{
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
GdkDisplay *display = source->display;
@@ -110,7 +111,8 @@ static GSourceFuncs wl_glib_source_funcs = {
};
void
-_gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event)
+_gdk_wayland_display_deliver_event (GdkDisplay *display,
+ GdkEvent *event)
{
GList *node;
diff --git a/gdk/wayland/gdkglcontext-wayland.c b/gdk/wayland/gdkglcontext-wayland.c
index 395b497..9598e19 100644
--- a/gdk/wayland/gdkglcontext-wayland.c
+++ b/gdk/wayland/gdkglcontext-wayland.c
@@ -95,7 +95,8 @@ gdk_wayland_window_invalidate_for_new_frame (GdkWindow *window,
window_rect.height = gdk_window_get_height (window);
/* If nothing else is known, repaint everything so that the back
- buffer is fully up-to-date for the swapbuffer */
+ * buffer is fully up-to-date for the swapbuffer
+ */
cairo_region_union_rectangle (update_area, &window_rect);
}
}
@@ -165,7 +166,7 @@ gdk_wayland_gl_context_realize (GdkGLContext *context,
}
static void
-gdk_wayland_gl_context_end_frame (GdkGLContext *context,
+gdk_wayland_gl_context_end_frame (GdkGLContext *context,
cairo_region_t *painted,
cairo_region_t *damage)
{
@@ -180,7 +181,7 @@ gdk_wayland_gl_context_end_frame (GdkGLContext *context,
egl_surface = gdk_wayland_window_get_egl_surface (window->impl_window,
context_wayland->egl_config);
- // TODO: Use eglSwapBuffersWithDamageEXT if available
+ /* TODO: Use eglSwapBuffersWithDamageEXT if available */
if (display_wayland->have_egl_swap_buffers_with_damage)
{
int i, j, n_rects = cairo_region_num_rectangles (damage);
diff --git a/gdk/wayland/gdkkeys-wayland.c b/gdk/wayland/gdkkeys-wayland.c
index bdd0d54..814ef34 100644
--- a/gdk/wayland/gdkkeys-wayland.c
+++ b/gdk/wayland/gdkkeys-wayland.c
@@ -250,7 +250,7 @@ get_xkb_modifiers (struct xkb_keymap *xkb_keymap,
if (state & GDK_MOD1_MASK)
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT);
if (state & GDK_MOD2_MASK)
- mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod2");
+ mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_NUM);
if (state & GDK_MOD3_MASK)
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod3");
if (state & GDK_MOD4_MASK)
@@ -275,7 +275,7 @@ get_gdk_modifiers (struct xkb_keymap *xkb_keymap,
state |= GDK_CONTROL_MASK;
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT)))
state |= GDK_MOD1_MASK;
- if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod2")))
+ if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_NUM)))
state |= GDK_MOD2_MASK;
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod3")))
state |= GDK_MOD3_MASK;
@@ -457,7 +457,7 @@ update_direction (GdkWaylandKeymap *keymap)
}
GdkKeymap *
-_gdk_wayland_keymap_new ()
+_gdk_wayland_keymap_new (void)
{
GdkWaylandKeymap *keymap;
struct xkb_context *context;
@@ -494,12 +494,12 @@ _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap,
context = xkb_context_new (0);
- map_str = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
+ map_str = mmap (NULL, size, PROT_READ, MAP_SHARED, fd, 0);
if (map_str == MAP_FAILED)
{
close(fd);
return;
- }
+ }
xkb_keymap = xkb_keymap_new_from_string (context, map_str, format, 0);
munmap (map_str, size);
@@ -523,12 +523,14 @@ _gdk_wayland_keymap_update_from_fd (GdkKeymap *keymap,
update_direction (keymap_wayland);
}
-struct xkb_keymap *_gdk_wayland_keymap_get_xkb_keymap (GdkKeymap *keymap)
+struct xkb_keymap *
+_gdk_wayland_keymap_get_xkb_keymap (GdkKeymap *keymap)
{
return GDK_WAYLAND_KEYMAP (keymap)->xkb_keymap;
}
-struct xkb_state *_gdk_wayland_keymap_get_xkb_state (GdkKeymap *keymap)
+struct xkb_state *
+_gdk_wayland_keymap_get_xkb_state (GdkKeymap *keymap)
{
return GDK_WAYLAND_KEYMAP (keymap)->xkb_state;
}
diff --git a/gdk/wayland/gdkprivate-wayland.h b/gdk/wayland/gdkprivate-wayland.h
index 8a97df0..8fba6b7 100644
--- a/gdk/wayland/gdkprivate-wayland.h
+++ b/gdk/wayland/gdkprivate-wayland.h
@@ -19,11 +19,11 @@
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
/*
- * Private uninstalled header defining things local to X windowing code
+ * Private uninstalled header defining things local to the Wayland backend
*/
#ifndef __GDK_PRIVATE_WAYLAND_H__
diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c
index 980aa6b..122fafa 100644
--- a/gdk/wayland/gdkscreen-wayland.c
+++ b/gdk/wayland/gdkscreen-wayland.c
@@ -223,7 +223,9 @@ gdk_wayland_screen_get_monitor_width_mm (GdkScreen *screen,
gint monitor_num)
{
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
- GdkWaylandMonitor *monitor = g_ptr_array_index(screen_wayland->monitors, monitor_num);
+ GdkWaylandMonitor *monitor;
+
+ monitor = g_ptr_array_index (screen_wayland->monitors, monitor_num);
return monitor->width_mm;
}
@@ -233,7 +235,9 @@ gdk_wayland_screen_get_monitor_height_mm (GdkScreen *screen,
gint monitor_num)
{
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
- GdkWaylandMonitor *monitor = g_ptr_array_index(screen_wayland->monitors, monitor_num);
+ GdkWaylandMonitor *monitor;
+
+ monitor = g_ptr_array_index (screen_wayland->monitors, monitor_num);
return monitor->height_mm;
}
@@ -243,7 +247,9 @@ gdk_wayland_screen_get_monitor_plug_name (GdkScreen *screen,
gint monitor_num)
{
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
- GdkWaylandMonitor *monitor = g_ptr_array_index(screen_wayland->monitors, monitor_num);
+ GdkWaylandMonitor *monitor;
+
+ monitor = g_ptr_array_index (screen_wayland->monitors, monitor_num);
return g_strdup (monitor->output_name);
}
@@ -254,7 +260,9 @@ gdk_wayland_screen_get_monitor_geometry (GdkScreen *screen,
GdkRectangle *dest)
{
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
- GdkWaylandMonitor *monitor = g_ptr_array_index(screen_wayland->monitors, monitor_num);
+ GdkWaylandMonitor *monitor;
+
+ monitor = g_ptr_array_index (screen_wayland->monitors, monitor_num);
if (dest)
*dest = monitor->geometry;
@@ -267,10 +275,7 @@ gdk_wayland_screen_get_monitor_scale_factor (GdkScreen *screen,
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
GdkWaylandMonitor *monitor;
- if (monitor_num >= screen_wayland->monitors->len)
- return 1;
-
- monitor = g_ptr_array_index(screen_wayland->monitors, monitor_num);
+ monitor = g_ptr_array_index (screen_wayland->monitors, monitor_num);
return monitor->scale;
}
@@ -358,17 +363,17 @@ typedef enum
static gdouble
get_dpi_from_gsettings (GdkWaylandScreen *screen_wayland)
{
- GSettings *interface_settings;
- gdouble factor;
+ GSettings *settings;
+ gdouble factor;
- interface_settings = g_hash_table_lookup (screen_wayland->settings,
- "org.gnome.desktop.interface");
- if (interface_settings != NULL)
- factor = g_settings_get_double (interface_settings, "text-scaling-factor");
- else
- factor = 1.0;
+ settings = g_hash_table_lookup (screen_wayland->settings,
+ "org.gnome.desktop.interface");
+ if (settings != NULL)
+ factor = g_settings_get_double (settings, "text-scaling-factor");
+ else
+ factor = 1.0;
- return 96.0 * factor;
+ return 96.0 * factor;
}
static void
@@ -547,7 +552,8 @@ static TranslationEntry translations[] = {
};
static TranslationEntry *
-find_translation_entry_by_key (GSettings *settings, const gchar *key)
+find_translation_entry_by_key (GSettings *settings,
+ const gchar *key)
{
guint i;
gchar *schema;
@@ -750,8 +756,8 @@ set_decoration_layout_from_entry (GdkScreen *screen,
static gboolean
set_capability_setting (GdkScreen *screen,
- GValue *value,
- enum gtk_shell_capability test)
+ GValue *value,
+ enum gtk_shell_capability test)
{
GdkWaylandScreen *wayland_screen = GDK_WAYLAND_SCREEN (screen);
@@ -762,8 +768,8 @@ set_capability_setting (GdkScreen *screen,
static gboolean
gdk_wayland_screen_get_setting (GdkScreen *screen,
- const gchar *name,
- GValue *value)
+ const gchar *name,
+ GValue *value)
{
TranslationEntry *entry;
@@ -1017,11 +1023,16 @@ update_screen_size (GdkWaylandScreen *screen_wayland)
}
static void
-output_handle_geometry(void *data,
- struct wl_output *wl_output,
- int x, int y, int physical_width, int physical_height,
- int subpixel, const char *make, const char *model,
- int32_t transform)
+output_handle_geometry (void *data,
+ struct wl_output *wl_output,
+ int x,
+ int y,
+ int physical_width,
+ int physical_height,
+ int subpixel,
+ const char *make,
+ const char *model,
+ int32_t transform)
{
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
@@ -1042,8 +1053,8 @@ output_handle_geometry(void *data,
}
static void
-output_handle_done(void *data,
- struct wl_output *wl_output)
+output_handle_done (void *data,
+ struct wl_output *wl_output)
{
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
@@ -1052,9 +1063,9 @@ output_handle_done(void *data,
}
static void
-output_handle_scale(void *data,
- struct wl_output *wl_output,
- int32_t factor)
+output_handle_scale (void *data,
+ struct wl_output *wl_output,
+ int32_t factor)
{
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
@@ -1063,12 +1074,12 @@ output_handle_scale(void *data,
}
static void
-output_handle_mode(void *data,
- struct wl_output *wl_output,
- uint32_t flags,
- int width,
- int height,
- int refresh)
+output_handle_mode (void *data,
+ struct wl_output *wl_output,
+ uint32_t flags,
+ int width,
+ int height,
+ int refresh)
{
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
@@ -1101,16 +1112,19 @@ _gdk_wayland_screen_add_output (GdkScreen *screen,
guint32 version)
{
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
- GdkWaylandMonitor *monitor = g_new0(GdkWaylandMonitor, 1);
+ GdkWaylandMonitor *monitor;
+
+ monitor = g_new0 (GdkWaylandMonitor, 1);
monitor->id = id;
monitor->output = output;
monitor->version = version;
monitor->screen = screen_wayland;
monitor->scale = 1;
- g_ptr_array_add(screen_wayland->monitors, monitor);
- wl_output_add_listener(output, &output_listener, monitor);
+ g_ptr_array_add (screen_wayland->monitors, monitor);
+
+ wl_output_add_listener (output, &output_listener, monitor);
}
void
diff --git a/gdk/wayland/gdkselection-wayland.c b/gdk/wayland/gdkselection-wayland.c
index 6fdec8f..39a5f22 100644
--- a/gdk/wayland/gdkselection-wayland.c
+++ b/gdk/wayland/gdkselection-wayland.c
@@ -64,7 +64,8 @@ struct _DataSourceData
GdkAtom selection;
};
-struct _AsyncWriteData {
+struct _AsyncWriteData
+{
GOutputStream *stream;
GdkWaylandSelection *selection;
gsize index;
@@ -268,8 +269,9 @@ gdk_wayland_selection_new (void)
atoms[ATOM_DND] = gdk_atom_intern_static_string ("GdkWaylandSelection");
selection = g_new0 (GdkWaylandSelection, 1);
- selection->selection_buffers = g_hash_table_new_full (NULL, NULL, NULL,
- (GDestroyNotify) selection_buffer_cancel_and_unref);
+ selection->selection_buffers =
+ g_hash_table_new_full (NULL, NULL, NULL,
+ (GDestroyNotify) selection_buffer_cancel_and_unref);
return selection;
}
@@ -742,7 +744,8 @@ gdk_wayland_selection_get_data_source (GdkWindow *owner,
}
void
-gdk_wayland_selection_unset_data_source (GdkDisplay *display, GdkAtom selection)
+gdk_wayland_selection_unset_data_source (GdkDisplay *display,
+ GdkAtom selection)
{
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
@@ -772,7 +775,7 @@ gdk_wayland_selection_unset_data_source (GdkDisplay *display, GdkAtom selection)
GdkWindow *
_gdk_wayland_display_get_selection_owner (GdkDisplay *display,
- GdkAtom selection)
+ GdkAtom selection)
{
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
@@ -786,10 +789,10 @@ _gdk_wayland_display_get_selection_owner (GdkDisplay *display,
gboolean
_gdk_wayland_display_set_selection_owner (GdkDisplay *display,
- GdkWindow *owner,
- GdkAtom selection,
- guint32 time,
- gboolean send_event)
+ GdkWindow *owner,
+ GdkAtom selection,
+ guint32 time,
+ gboolean send_event)
{
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
@@ -809,20 +812,20 @@ _gdk_wayland_display_set_selection_owner (GdkDisplay *display,
void
_gdk_wayland_display_send_selection_notify (GdkDisplay *dispay,
- GdkWindow *requestor,
- GdkAtom selection,
- GdkAtom target,
- GdkAtom property,
- guint32 time)
+ GdkWindow *requestor,
+ GdkAtom selection,
+ GdkAtom target,
+ GdkAtom property,
+ guint32 time)
{
}
gint
_gdk_wayland_display_get_selection_property (GdkDisplay *display,
- GdkWindow *requestor,
- guchar **data,
- GdkAtom *ret_type,
- gint *ret_format)
+ GdkWindow *requestor,
+ guchar **data,
+ GdkAtom *ret_type,
+ gint *ret_format)
{
SelectionBuffer *buffer_data;
gsize len;
@@ -864,10 +867,10 @@ _gdk_wayland_display_get_selection_property (GdkDisplay *display,
void
_gdk_wayland_display_convert_selection (GdkDisplay *display,
- GdkWindow *requestor,
- GdkAtom selection,
- GdkAtom target,
- guint32 time)
+ GdkWindow *requestor,
+ GdkAtom selection,
+ GdkAtom target,
+ guint32 time)
{
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
SelectionBuffer *buffer_data;
@@ -950,11 +953,11 @@ _gdk_wayland_display_convert_selection (GdkDisplay *display,
gint
_gdk_wayland_display_text_property_to_utf8_list (GdkDisplay *display,
- GdkAtom encoding,
- gint format,
- const guchar *text,
- gint length,
- gchar ***list)
+ GdkAtom encoding,
+ gint format,
+ const guchar *text,
+ gint length,
+ gchar ***list)
{
GPtrArray *array;
const gchar *ptr;
@@ -991,7 +994,7 @@ _gdk_wayland_display_text_property_to_utf8_list (GdkDisplay *display,
gchar *
_gdk_wayland_display_utf8_to_string_target (GdkDisplay *display,
- const gchar *str)
+ const gchar *str)
{
return NULL;
}
@@ -1029,7 +1032,8 @@ gdk_wayland_selection_add_targets (GdkWindow *window,
}
void
-gdk_wayland_selection_clear_targets (GdkDisplay *display, GdkAtom selection)
+gdk_wayland_selection_clear_targets (GdkDisplay *display,
+ GdkAtom selection)
{
gdk_wayland_selection_unset_data_source (display, selection);
}
diff --git a/gdk/wayland/gdkwayland.h b/gdk/wayland/gdkwayland.h
index 39c887c..64f64b6 100644
--- a/gdk/wayland/gdkwayland.h
+++ b/gdk/wayland/gdkwayland.h
@@ -19,7 +19,7 @@
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GDK_WAYLAND_H__
diff --git a/gdk/wayland/gdkwaylandselection.h b/gdk/wayland/gdkwaylandselection.h
index bc58102..d201e61 100644
--- a/gdk/wayland/gdkwaylandselection.h
+++ b/gdk/wayland/gdkwaylandselection.h
@@ -19,7 +19,7 @@
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GDK_WAYLAND_SELECTION_H__
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index cc0d3b4..4d2a20b 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -51,11 +51,13 @@
typedef struct _GdkWaylandWindow GdkWaylandWindow;
typedef struct _GdkWaylandWindowClass GdkWaylandWindowClass;
-struct _GdkWaylandWindow {
+struct _GdkWaylandWindow
+{
GdkWindow parent;
};
-struct _GdkWaylandWindowClass {
+struct _GdkWaylandWindowClass
+{
GdkWindowClass parent_class;
};
@@ -218,14 +220,13 @@ _gdk_wayland_screen_create_root_window (GdkScreen *screen,
impl->wrapper = GDK_WINDOW (window);
if (wayland_display->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE &&
- gdk_screen_get_n_monitors(screen) > 0)
+ gdk_screen_get_n_monitors (screen) > 0)
impl->scale = gdk_screen_get_monitor_scale_factor (screen, 0);
/* logical 1x1 fake buffer */
- impl->cairo_surface =
- cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
- impl->scale,
- impl->scale);
+ impl->cairo_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
+ impl->scale,
+ impl->scale);
cairo_surface_set_device_scale (impl->cairo_surface, impl->scale, impl->scale);
@@ -424,15 +425,12 @@ window_update_scale (GdkWindow *window)
for (l = impl->outputs; l != NULL; l = l->next)
{
guint32 output_scale =
- _gdk_wayland_screen_get_output_scale (wayland_display->screen,
- l->data);
+ _gdk_wayland_screen_get_output_scale (wayland_display->screen, l->data);
scale = MAX (scale, output_scale);
}
/* Notify app that scale changed */
- gdk_wayland_window_configure (window,
- window->width, window->height,
- scale);
+ gdk_wayland_window_configure (window, window->width, window->height, scale);
}
static void
@@ -463,15 +461,15 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
window->impl = GDK_WINDOW_IMPL (impl);
impl->wrapper = GDK_WINDOW (window);
- if (window->width > 65535 ||
- window->height > 65535)
+ if (window->width > 65535)
{
- g_warning ("Native Windows wider or taller than 65535 pixels are not supported");
-
- if (window->width > 65535)
- window->width = 65535;
- if (window->height > 65535)
- window->height = 65535;
+ g_warning ("Native Windows wider than 65535 pixels are not supported");
+ window->width = 65535;
+ }
+ if (window->height > 65535)
+ {
+ g_warning ("Native Windows taller than 65535 pixels are not supported");
+ window->height = 65535;
}
g_object_ref (window);
@@ -599,7 +597,9 @@ static gboolean
gdk_window_impl_wayland_begin_paint (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+
gdk_wayland_window_ensure_cairo_surface (window);
+
if (_gdk_wayland_is_shm_surface (impl->cairo_surface))
return _gdk_wayland_shm_surface_get_busy (impl->cairo_surface);
else
@@ -621,8 +621,7 @@ gdk_window_impl_wayland_end_paint (GdkWindow *window)
for (i = 0; i < n; i++)
{
cairo_region_get_rectangle (window->current_paint.region, i, &rect);
- wl_surface_damage (impl->surface,
- rect.x, rect.y, rect.width, rect.height);
+ wl_surface_damage (impl->surface, rect.x, rect.y, rect.width, rect.height);
impl->pending_commit = TRUE;
}
}
@@ -893,7 +892,7 @@ xdg_surface_configure (void *data,
gdk_wayland_window_configure (window, width, height, impl->scale);
}
- wl_array_for_each(p, states)
+ wl_array_for_each (p, states)
{
uint32_t state = *p;
switch (state)
@@ -921,7 +920,7 @@ xdg_surface_configure (void *data,
}
static void
-xdg_surface_close (void *data,
+xdg_surface_close (void *data,
struct xdg_surface *xdg_surface)
{
GdkWindow *window = GDK_WINDOW (data);
@@ -1031,11 +1030,11 @@ gdk_wayland_window_get_fake_root_coords (GdkWindow *window,
}
static void
-gdk_wayland_window_create_xdg_popup (GdkWindow *window,
- GdkWindow *parent,
- struct wl_seat *seat)
+gdk_wayland_window_create_xdg_popup (GdkWindow *window,
+ GdkWindow *parent,
+ struct wl_seat *seat)
{
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkWindowImplWayland *parent_impl = GDK_WINDOW_IMPL_WAYLAND (parent->impl);
GdkDeviceManager *device_manager;
@@ -1049,7 +1048,7 @@ gdk_wayland_window_create_xdg_popup (GdkWindow *window,
if (!parent_impl->surface)
return;
- device_manager = gdk_display_get_device_manager (GDK_DISPLAY (display_wayland));
+ device_manager = gdk_display_get_device_manager (GDK_DISPLAY (display));
device = GDK_WAYLAND_DEVICE (gdk_device_manager_get_client_pointer (device_manager));
gdk_wayland_window_get_fake_root_coords (parent, &parent_x, &parent_y);
@@ -1063,7 +1062,7 @@ gdk_wayland_window_create_xdg_popup (GdkWindow *window,
y -= parent_impl->margin_top;
}
- impl->xdg_popup = xdg_shell_get_xdg_popup (display_wayland->xdg_shell,
+ impl->xdg_popup = xdg_shell_get_xdg_popup (display->xdg_shell,
impl->surface,
parent_impl->surface,
seat,
@@ -1607,18 +1606,6 @@ gdk_wayland_window_set_geometry_hints (GdkWindow *window,
impl->geometry_hints = *geometry;
impl->geometry_mask = geom_mask;
-
- /*
- * GDK_HINT_POS
- * GDK_HINT_USER_POS
- * GDK_HINT_USER_SIZE
- * GDK_HINT_MIN_SIZE
- * GDK_HINT_MAX_SIZE
- * GDK_HINT_BASE_SIZE
- * GDK_HINT_RESIZE_INC
- * GDK_HINT_ASPECT
- * GDK_HINT_WIN_GRAVITY
- */
}
static void
@@ -1831,9 +1818,6 @@ static void
gdk_wayland_window_set_group (GdkWindow *window,
GdkWindow *leader)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
- g_return_if_fail (leader == NULL || GDK_IS_WINDOW (leader));
}
static void
@@ -2253,10 +2237,10 @@ _gdk_wayland_window_set_device_grabbed (GdkWindow *window,
}
/**
- * gdk_wayland_window_get_wl_surface
+ * gdk_wayland_window_get_wl_surface:
* @window: (type GdkWaylandWindow): a #GdkWindow
*
- * Returns the Wayland surface of a #GdkWindow
+ * Returns the Wayland surface of a #GdkWindow.
*
* Returns: (transfer none): a Wayland wl_surface
*
@@ -2265,30 +2249,22 @@ _gdk_wayland_window_set_device_grabbed (GdkWindow *window,
struct wl_surface *
gdk_wayland_window_get_wl_surface (GdkWindow *window)
{
- GdkWindowImplWayland *impl;
-
g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL);
- impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
-
- return impl->surface;
+ return GDK_WINDOW_IMPL_WAYLAND (window->impl)->surface;
}
static struct wl_egl_window *
gdk_wayland_window_get_wl_egl_window (GdkWindow *window)
{
- GdkWindowImplWayland *impl;
-
- g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL);
-
- impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
if (impl->egl_window == NULL)
{
impl->egl_window =
- wl_egl_window_create(impl->surface,
- impl->wrapper->width * impl->scale,
- impl->wrapper->height * impl->scale);
+ wl_egl_window_create (impl->surface,
+ impl->wrapper->width * impl->scale,
+ impl->wrapper->height * impl->scale);
wl_surface_set_buffer_scale (impl->surface, impl->scale);
}
@@ -2297,9 +2273,9 @@ gdk_wayland_window_get_wl_egl_window (GdkWindow *window)
EGLSurface
gdk_wayland_window_get_egl_surface (GdkWindow *window,
- EGLConfig config)
+ EGLConfig config)
{
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
GdkWindowImplWayland *impl;
struct wl_egl_window *egl_window;
@@ -2312,8 +2288,7 @@ gdk_wayland_window_get_egl_surface (GdkWindow *window,
egl_window = gdk_wayland_window_get_wl_egl_window (window);
impl->egl_surface =
- eglCreateWindowSurface (display_wayland->egl_display,
- config, egl_window, NULL);
+ eglCreateWindowSurface (display->egl_display, config, egl_window, NULL);
}
return impl->egl_surface;
@@ -2321,9 +2296,9 @@ gdk_wayland_window_get_egl_surface (GdkWindow *window,
EGLSurface
gdk_wayland_window_get_dummy_egl_surface (GdkWindow *window,
- EGLConfig config)
+ EGLConfig config)
{
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
GdkWindowImplWayland *impl;
g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL);
@@ -2336,8 +2311,7 @@ gdk_wayland_window_get_dummy_egl_surface (GdkWindow *window,
wl_egl_window_create (impl->surface, 1, 1);
impl->dummy_egl_surface =
- eglCreateWindowSurface (display_wayland->egl_display,
- config, impl->dummy_egl_window, NULL);
+ eglCreateWindowSurface (display->egl_display, config, impl->dummy_egl_window, NULL);
}
return impl->dummy_egl_surface;
@@ -2412,7 +2386,7 @@ gdk_wayland_window_set_dbus_properties_libgtk_only (GdkWindow *window,
const char *application_object_path,
const char *unique_bus_name)
{
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
GdkWindowImplWayland *impl;
g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window));
@@ -2423,10 +2397,11 @@ gdk_wayland_window_set_dbus_properties_libgtk_only (GdkWindow *window,
{
if (impl->xdg_surface == NULL)
return;
- if (display_wayland->gtk_shell == NULL)
+
+ if (display->gtk_shell == NULL)
return;
- impl->gtk_surface = gtk_shell_get_gtk_surface (display_wayland->gtk_shell, impl->surface);
+ impl->gtk_surface = gtk_shell_get_gtk_surface (display->gtk_shell, impl->surface);
}
gtk_surface_set_dbus_properties (impl->gtk_surface,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]