wlmaker
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
xwl_surface.c File Reference
#include "xwl_surface.h"
#include <inttypes.h>
#include <libbase/libbase.h>
#include <stdbool.h>
#include <stdlib.h>
#include <wayland-server-core.h>
#include <wayland-util.h>
#include <wlr/types/wlr_compositor.h>
#include <wlr/util/box.h>
#include <wlr/version.h>
#include <wlr/xwayland/xwayland.h>
#include "toolkit/toolkit.h"
Include dependency graph for xwl_surface.c:

Classes

struct  _wlmaker_xwl_surface_t
 

Functions

static void _xwl_surface_handle_destroy (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_surface_handle_request_configure (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_surface_handle_associate (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_surface_handle_dissociate (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_surface_handle_set_title (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_surface_handle_set_parent (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_surface_handle_set_decorations (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_surface_handle_set_geometry (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_surface_handle_surface_map (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_surface_handle_surface_unmap (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_surface_handle_surface_commit (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _wlmaker_xwl_surface_handle_window_request_close (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _wlmaker_xwl_surface_handle_window_set_activated (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _wlmaker_xwl_surface_handle_window_request_size (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _wlmaker_xwl_surface_handle_window_request_fullscreen (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _wlmaker_xwl_surface_handle_window_request_maximized (struct wl_listener *listener_ptr, void *data_ptr)
 
static void _xwl_surface_apply_decorations (wlmaker_xwl_surface_t *xwl_surface_ptr)
 
static void _xwl_surface_adjust_absolute_pos (wlmaker_xwl_surface_t *surface_ptr, int *x_ptr, int *y_ptr)
 
wlmaker_xwl_surface_twlmaker_xwl_surface_create (struct wlr_xwayland_surface *wlr_xwayland_surface_ptr, wlmaker_xwl_t *xwl_ptr, wlmaker_server_t *server_ptr)
 
void wlmaker_xwl_surface_destroy (wlmaker_xwl_surface_t *xwl_surface_ptr)
 
static void test_create_destroy (bs_test_t *test_ptr)
 
static void test_nested (bs_test_t *test_ptr)
 
static void fake_init_wlr_xwayland_surface (struct wlr_xwayland_surface *wlr_xwayland_surface_ptr)
 

Variables

static const bs_test_case_t wlmaker_xwl_surface_test_cases []
 
const bs_test_set_t wlmaker_xwl_surface_test_set
 

Detailed Description

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ _wlmaker_xwl_surface_handle_window_request_close()

void _wlmaker_xwl_surface_handle_window_request_close ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Close button got clicked, forward to the XWL surface.

◆ _wlmaker_xwl_surface_handle_window_request_fullscreen()

void _wlmaker_xwl_surface_handle_window_request_fullscreen ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

The window is requested to go fullscreen. Forward and commit that.

◆ _wlmaker_xwl_surface_handle_window_request_maximized()

void _wlmaker_xwl_surface_handle_window_request_maximized ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

The window is requested to go maximized. Forward and commit that.

◆ _wlmaker_xwl_surface_handle_window_request_size()

void _wlmaker_xwl_surface_handle_window_request_size ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

A new size was requested. Forward to the XWL surface.

◆ _wlmaker_xwl_surface_handle_window_set_activated()

void _wlmaker_xwl_surface_handle_window_set_activated ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Surface became activated. Do that.

◆ _xwl_surface_adjust_absolute_pos()

void _xwl_surface_adjust_absolute_pos ( wlmaker_xwl_surface_t surface_ptr,
int *  x_ptr,
int *  y_ptr 
)
static

Adjusts the absolute position by subtracting each parent's position.

Parameters
surface_ptr
x_ptr
y_ptr

◆ _xwl_surface_apply_decorations()

void _xwl_surface_apply_decorations ( wlmaker_xwl_surface_t xwl_surface_ptr)
static

Sets whether this window should be server-side-decorated.

Parameters
xwl_surface_ptr

◆ _xwl_surface_handle_associate()

void _xwl_surface_handle_associate ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the associate event of struct wlr_xwayland_surface.

The associate event is triggered once an X11 window becomes associated with the surface. Understanding this is a moment the surface can be mapped.

Parameters
listener_ptr
data_ptr

◆ _xwl_surface_handle_destroy()

void _xwl_surface_handle_destroy ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the destroy event of struct wlr_xwayland_surface.

Parameters
listener_ptr
data_ptr

◆ _xwl_surface_handle_dissociate()

void _xwl_surface_handle_dissociate ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the dissociate event of struct wlr_xwayland_surface.

Parameters
listener_ptr
data_ptr

◆ _xwl_surface_handle_request_configure()

void _xwl_surface_handle_request_configure ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the request_configure event of struct wlr_xwayland_surface.

Parameters
listener_ptr
data_ptr

◆ _xwl_surface_handle_set_decorations()

void _xwl_surface_handle_set_decorations ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the set_decorations event of struct wlr_xwayland_surface.

Applies server-side decoration, if the X11 window is supposed to have decorations.

Parameters
listener_ptr
data_ptr

◆ _xwl_surface_handle_set_geometry()

void _xwl_surface_handle_set_geometry ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the set_geometry event of struct wlr_xwayland_surface.

Called from wlroots/xwayland/xwm.c, whenever the geometry (position or dimensions) of the window (precisely: the xwayland_surface) changes.

Parameters
listener_ptr
data_ptr

◆ _xwl_surface_handle_set_parent()

void _xwl_surface_handle_set_parent ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the set_parent event of struct wlr_xwayland_surface.

Parameters
listener_ptr
data_ptr

◆ _xwl_surface_handle_set_title()

void _xwl_surface_handle_set_title ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handler for the set_title event of struct wlr_xwayland_surface.

Parameters
listener_ptr
data_ptr

◆ _xwl_surface_handle_surface_commit()

void _xwl_surface_handle_surface_commit ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Surface committed. Update size.

◆ _xwl_surface_handle_surface_map()

void _xwl_surface_handle_surface_map ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Handles when the surface is mapped: Map it to the workspace.

◆ _xwl_surface_handle_surface_unmap()

void _xwl_surface_handle_surface_unmap ( struct wl_listener *  listener_ptr,
void *  data_ptr 
)
static

Unmaps the window

◆ fake_init_wlr_xwayland_surface()

void fake_init_wlr_xwayland_surface ( struct wlr_xwayland_surface *  wlr_xwayland_surface_ptr)
static

Fake-initializes the wlr_xwayland_surface_ptr.

◆ test_create_destroy()

void test_create_destroy ( bs_test_t *  test_ptr)
static

Tests setup and teardown.

◆ test_nested()

void test_nested ( bs_test_t *  test_ptr)
static

Tests nesting of XWayland surfaces, ie. parenting.

◆ wlmaker_xwl_surface_create()

wlmaker_xwl_surface_t * wlmaker_xwl_surface_create ( struct wlr_xwayland_surface *  wlr_xwayland_surface_ptr,
wlmaker_xwl_t xwl_ptr,
wlmaker_server_t server_ptr 
)

Creates an XWayland window. Technically, window surface.

Parameters
wlr_xwayland_surface_ptr
xwl_ptr
server_ptr
Returns
Pointer to a wlmaker_xwl_surface_t.

◆ wlmaker_xwl_surface_destroy()

void wlmaker_xwl_surface_destroy ( wlmaker_xwl_surface_t xwl_surface_ptr)

Destroys the XWayland window (surface).

Parameters
xwl_surface_ptr

Variable Documentation

◆ wlmaker_xwl_surface_test_cases

const bs_test_case_t wlmaker_xwl_surface_test_cases[]
static
Initial value:
= {
{ true, "create_destroy", test_create_destroy },
{ true, "nested", test_nested },
}
static void test_create_destroy(bs_test_t *test_ptr)
Definition xwl_surface.c:810
static void test_nested(bs_test_t *test_ptr)
Definition xwl_surface.c:825

Unit test cases.

◆ wlmaker_xwl_surface_test_set

const bs_test_set_t wlmaker_xwl_surface_test_set
Initial value:
= BS_TEST_SET(
true, "xwl_surface", wlmaker_xwl_surface_test_cases)
static const bs_test_case_t wlmaker_xwl_surface_test_cases[]
Definition xwl_surface.c:799

Unit test set for XWL surface.