Commit 89e32d00 authored by Olivier Fourdan's avatar Olivier Fourdan
Browse files

xwayland: Move Xwayland windows to its own sources



Over time, Xwayland main source file `xwayland.c` has grown in size
which makes it look cluttered and harder to read.

Move the code dealing with Xwayland window to its own source and header
files.
Signed-off-by: default avatarOlivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Michel Dänzer's avatarMichel Dänzer <mdaenzer@redhat.com>
parent 3a59650b
......@@ -20,6 +20,8 @@ Xwayland_SOURCES = \
xwayland-output.c \
xwayland-cvt.c \
xwayland-vidmode.c \
xwayland-window.c \
xwayland-window.h \
xwayland-window-buffers.c \
xwayland-window-buffers.h \
xwayland.h \
......
......@@ -9,6 +9,8 @@ srcs = [
'xwayland-output.c',
'xwayland-cvt.c',
'xwayland-vidmode.c',
'xwayland-window.c',
'xwayland-window.h',
'xwayland-window-buffers.c',
'xwayland-window-buffers.h',
'../../mi/miinitext.c',
......
......@@ -39,6 +39,7 @@
#include "xwayland.h"
#include "xwayland-glamor.h"
#include "xwayland-window.h"
static void
glamor_egl_make_current(struct glamor_context *glamor_ctx)
......
......@@ -24,18 +24,28 @@
* SOFTWARE.
*/
#include "xwayland.h"
#include <xwayland-config.h>
#include <linux/input.h>
#include <sys/mman.h>
#include <inputstr.h>
#include <exevents.h>
#include <xkbsrv.h>
#include <xserver-properties.h>
#include <inpututils.h>
#include <mi.h>
#include <mipointer.h>
#include <mipointrst.h>
#include <misc.h>
#include "xwayland.h"
#include "xwayland-window.h"
#include "pointer-constraints-unstable-v1-client-protocol.h"
#include "relative-pointer-unstable-v1-client-protocol.h"
#include "tablet-unstable-v2-client-protocol.h"
#include "xwayland-keyboard-grab-unstable-v1-client-protocol.h"
struct axis_discrete_pending {
struct xorg_list l;
......
......@@ -23,14 +23,16 @@
* SOFTWARE.
*/
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <xwayland-config.h>
#include "xwayland.h"
#include <randrstr.h>
#include <X11/Xatom.h>
#include "xwayland.h"
#include "xwayland-window.h"
#include "xdg-output-unstable-v1-client-protocol.h"
#define DEFAULT_DPI 96
#define ALL_ROTATIONS (RR_Rotate_0 | \
RR_Rotate_90 | \
......
......@@ -23,11 +23,17 @@
* SOFTWARE.
*/
#include "xwayland.h"
#include "glamor.h"
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
#include <windowstr.h>
#include <present.h>
#include "xwayland.h"
#include "xwayland-window.h"
#include "glamor.h"
/*
* When not flipping let Present copy with 60fps.
* When flipping wait on frame_callback, otherwise
......
......@@ -24,6 +24,11 @@
* Olivier Fourdan <ofourdan@redhat.com>
*/
#include <xwayland-config.h>
#include "gcstruct.h"
#include "xwayland-window.h"
#include "xwayland-window-buffers.h"
#define BUFFER_TIMEOUT 1 * 1000 /* ms */
......
This diff is collapsed.
/*
* Copyright © 2011-2014 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that the above copyright notice appear in all copies
* and that both that copyright notice and this permission notice
* appear in supporting documentation, and that the name of the
* copyright holders not be used in advertising or publicity
* pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied
* warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#ifndef XWAYLAND_WINDOW_H
#define XWAYLAND_WINDOW_H
#include <xwayland-config.h>
#include <stdio.h>
#include <unistd.h>
#include <X11/X.h>
#include <dix.h>
#include <propertyst.h>
#include "xwayland-types.h"
struct xwl_window {
struct xwl_screen *xwl_screen;
struct wl_surface *surface;
struct wp_viewport *viewport;
int32_t x, y, width, height;
float scale_x, scale_y;
struct wl_shell_surface *shell_surface;
WindowPtr window;
struct xorg_list link_damage;
struct xorg_list link_window;
struct wl_callback *frame_callback;
Bool allow_commits;
struct xorg_list window_buffers_available;
struct xorg_list window_buffers_unavailable;
OsTimerPtr window_buffers_timer;
#ifdef GLAMOR_HAS_GBM
struct xorg_list frame_callback_list;
Bool present_flipped;
#endif
};
struct xwl_window *xwl_window_get(WindowPtr window);
struct xwl_window *xwl_window_from_window(WindowPtr window);
void xwl_window_update_property(struct xwl_window *xwl_window,
PropertyStateRec *propstate);
Bool xwl_window_has_viewport_enabled(struct xwl_window *xwl_window);
Bool xwl_window_is_toplevel(WindowPtr window);
void xwl_window_check_resolution_change_emulation(struct xwl_window *xwl_window);
void xwl_window_set_window_pixmap(WindowPtr window, PixmapPtr pixmap);
Bool xwl_realize_window(WindowPtr window);
Bool xwl_unrealize_window(WindowPtr window);
void xwl_resize_window(WindowPtr window,
int x, int y,
unsigned int width, unsigned int height,
WindowPtr sib);
Bool xwl_destroy_window(WindowPtr window);
void xwl_window_post_damage(struct xwl_window *xwl_window);
void xwl_window_create_frame_callback(struct xwl_window *xwl_window);
Bool xwl_window_init(void);
#endif /* XWAYLAND_WINDOW_H */
This diff is collapsed.
......@@ -123,27 +123,6 @@ struct xwl_screen {
Atom allow_commits_prop;
};
struct xwl_window {
struct xwl_screen *xwl_screen;
struct wl_surface *surface;
struct wp_viewport *viewport;
int32_t x, y, width, height;
float scale_x, scale_y;
struct wl_shell_surface *shell_surface;
WindowPtr window;
struct xorg_list link_damage;
struct xorg_list link_window;
struct wl_callback *frame_callback;
Bool allow_commits;
struct xorg_list window_buffers_available;
struct xorg_list window_buffers_unavailable;
OsTimerPtr window_buffers_timer;
#ifdef GLAMOR_HAS_GBM
struct xorg_list frame_callback_list;
Bool present_flipped;
#endif
};
#ifdef GLAMOR_HAS_GBM
struct xwl_present_window {
struct xwl_screen *xwl_screen;
......@@ -363,9 +342,6 @@ struct xwl_screen *xwl_screen_get(ScreenPtr screen);
Bool xwl_screen_has_resolution_change_emulation(struct xwl_screen *xwl_screen);
struct xwl_output *xwl_screen_get_first_output(struct xwl_screen *xwl_screen);
void xwl_screen_check_resolution_change_emulation(struct xwl_screen *xwl_screen);
void xwl_window_create_frame_callback(struct xwl_window *xwl_window);
Bool xwl_window_has_viewport_enabled(struct xwl_window *xwl_window);
Bool xwl_window_is_toplevel(WindowPtr window);
void xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *tool);
void xwl_seat_set_cursor(struct xwl_seat *xwl_seat);
......@@ -417,8 +393,6 @@ Bool xwl_pixmap_set_buffer_release_cb(PixmapPtr pixmap,
void xwl_pixmap_del_buffer_release_cb(PixmapPtr pixmap);
void xwl_pixmap_buffer_release_cb(void *data, struct wl_buffer *wl_buffer);
struct xwl_window *xwl_window_from_window(WindowPtr window);
#ifdef XWL_HAS_GLAMOR
#ifdef GLAMOR_HAS_GBM
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment