Dunst
Lightweight notification daemon
Loading...
Searching...
No Matches
wl.c File Reference
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <wayland-client.h>
#include <wayland-client-protocol.h>
#include <wayland-util.h>
#include <wayland-cursor.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <time.h>
#include <unistd.h>
#include <linux/input-event-codes.h>
#include <string.h>
#include <glib.h>
#include "protocols/xdg-shell-client-header.h"
#include "protocols/xdg-shell.h"
#include "protocols/wlr-layer-shell-unstable-v1-client-header.h"
#include "protocols/wlr-layer-shell-unstable-v1.h"
#include "protocols/wlr-foreign-toplevel-management-unstable-v1-client-header.h"
#include "protocols/wlr-foreign-toplevel-management-unstable-v1.h"
#include "wl.h"
#include "pool-buffer.h"
#include "../dunst.h"
#include "../log.h"
#include "../settings.h"
#include "libgwater-wayland.h"
#include "foreign_toplevel.h"
#include "wl_ctx.h"
#include "wl_output.h"
#include "wl_seat.h"
+ Include dependency graph for wl.c:

Go to the source code of this file.

Data Structures

struct  window_wl
 

Macros

#define _POSIX_C_SOURCE   200112L
 

Functions

static void surface_handle_enter (void *data, struct wl_surface *surface, struct wl_output *wl_output)
 
static void surface_handle_leave (void *data, struct wl_surface *surface, struct wl_output *wl_output)
 
static void schedule_frame_and_commit (void)
 
static void send_frame (void)
 
static void layer_surface_handle_configure (void *data, struct zwlr_layer_surface_v1 *surface, uint32_t serial, uint32_t width, uint32_t height)
 
static void xdg_surface_handle_configure (void *data, struct xdg_surface *surface, uint32_t serial)
 
static void xdg_toplevel_handle_configure (void *data, struct xdg_toplevel *xdg_toplevel, int32_t width, int32_t height, struct wl_array *states)
 
static void surface_handle_closed (void)
 
static void layer_surface_handle_closed (void *data, struct zwlr_layer_surface_v1 *surface)
 
static void xdg_toplevel_handle_close (void *data, struct xdg_toplevel *surface)
 
static void xdg_wm_base_handle_ping (void *data, struct xdg_wm_base *xdg_wm_base, uint32_t serial)
 
static struct dunst_outputget_configured_output (void)
 
static void handle_global (void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version)
 
static void handle_global_remove (void *data, struct wl_registry *registry, uint32_t name)
 
bool wl_init (void)
 
void wl_deinit (void)
 
static void frame_handle_done (void *data, struct wl_callback *callback, uint32_t time)
 
void set_dirty (void)
 
window wl_win_create (void)
 
void wl_win_destroy (window winptr)
 
void wl_win_show (window win)
 
void wl_win_hide (window win)
 
void wl_display_surface (cairo_surface_t *srf, window winptr, const struct dimensions *dim)
 
cairo_t * wl_win_get_context (window winptr)
 
const struct screen_infowl_get_active_screen (void)
 
bool wl_is_idle (void)
 
bool wl_have_fullscreen_window (void)
 
double wl_get_scale (void)
 

Variables

struct wl_ctx ctx = { 0 }
 
static const struct wl_surface_listener surface_listener
 
static const struct zwlr_layer_surface_v1_listener layer_surface_listener
 
static const struct xdg_wm_base_listener xdg_wm_base_listener
 
static const struct xdg_surface_listener xdg_surface_listener
 
static const struct xdg_toplevel_listener xdg_toplevel_listener
 
static const struct wl_registry_listener registry_listener
 
static const struct wl_callback_listener frame_listener
 

Detailed Description

License
BSD-3-Clause

Definition in file wl.c.

Macro Definition Documentation

◆ _POSIX_C_SOURCE

#define _POSIX_C_SOURCE   200112L

Definition at line 8 of file wl.c.

Function Documentation

◆ frame_handle_done()

static void frame_handle_done ( void * data,
struct wl_callback * callback,
uint32_t time )
static

Definition at line 660 of file wl.c.

◆ get_configured_output()

static struct dunst_output * get_configured_output ( void )
static

Definition at line 187 of file wl.c.

◆ handle_global()

static void handle_global ( void * data,
struct wl_registry * registry,
uint32_t name,
const char * interface,
uint32_t version )
static

Definition at line 223 of file wl.c.

◆ handle_global_remove()

static void handle_global_remove ( void * data,
struct wl_registry * registry,
uint32_t name )
static

Definition at line 269 of file wl.c.

◆ layer_surface_handle_closed()

static void layer_surface_handle_closed ( void * data,
struct zwlr_layer_surface_v1 * surface )
static

Definition at line 139 of file wl.c.

◆ layer_surface_handle_configure()

static void layer_surface_handle_configure ( void * data,
struct zwlr_layer_surface_v1 * surface,
uint32_t serial,
uint32_t width,
uint32_t height )
static

Definition at line 73 of file wl.c.

◆ schedule_frame_and_commit()

static void schedule_frame_and_commit ( void )
static

Definition at line 675 of file wl.c.

◆ send_frame()

static void send_frame ( void )
static

Definition at line 494 of file wl.c.

◆ set_dirty()

void set_dirty ( void )

Definition at line 691 of file wl.c.

◆ surface_handle_closed()

static void surface_handle_closed ( void )
static

Definition at line 117 of file wl.c.

◆ surface_handle_enter()

static void surface_handle_enter ( void * data,
struct wl_surface * surface,
struct wl_output * wl_output )
static

Definition at line 51 of file wl.c.

◆ surface_handle_leave()

static void surface_handle_leave ( void * data,
struct wl_surface * surface,
struct wl_output * wl_output )
static

Definition at line 59 of file wl.c.

◆ wl_deinit()

void wl_deinit ( void )

Definition at line 406 of file wl.c.

◆ wl_display_surface()

void wl_display_surface ( cairo_surface_t * srf,
window winptr,
const struct dimensions * dim )

Definition at line 722 of file wl.c.

◆ wl_get_active_screen()

const struct screen_info * wl_get_active_screen ( void )

Definition at line 759 of file wl.c.

◆ wl_get_scale()

double wl_get_scale ( void )

Definition at line 825 of file wl.c.

◆ wl_have_fullscreen_window()

bool wl_have_fullscreen_window ( void )

Definition at line 800 of file wl.c.

◆ wl_init()

bool wl_init ( void )

Definition at line 293 of file wl.c.

◆ wl_is_idle()

bool wl_is_idle ( void )

Definition at line 783 of file wl.c.

◆ wl_win_create()

window wl_win_create ( void )

Definition at line 699 of file wl.c.

◆ wl_win_destroy()

void wl_win_destroy ( window winptr)

Definition at line 704 of file wl.c.

◆ wl_win_get_context()

cairo_t * wl_win_get_context ( window winptr)

Definition at line 746 of file wl.c.

◆ wl_win_hide()

void wl_win_hide ( window win)

Definition at line 715 of file wl.c.

◆ wl_win_show()

void wl_win_show ( window win)

Definition at line 710 of file wl.c.

◆ xdg_surface_handle_configure()

static void xdg_surface_handle_configure ( void * data,
struct xdg_surface * surface,
uint32_t serial )
static

Definition at line 92 of file wl.c.

◆ xdg_toplevel_handle_close()

static void xdg_toplevel_handle_close ( void * data,
struct xdg_toplevel * surface )
static

Definition at line 149 of file wl.c.

◆ xdg_toplevel_handle_configure()

static void xdg_toplevel_handle_configure ( void * data,
struct xdg_toplevel * xdg_toplevel,
int32_t width,
int32_t height,
struct wl_array * states )
static

Definition at line 107 of file wl.c.

◆ xdg_wm_base_handle_ping()

static void xdg_wm_base_handle_ping ( void * data,
struct xdg_wm_base * xdg_wm_base,
uint32_t serial )
static

Definition at line 162 of file wl.c.

Variable Documentation

◆ ctx

struct wl_ctx ctx = { 0 }

Definition at line 49 of file wl.c.

◆ frame_listener

const struct wl_callback_listener frame_listener
static
Initial value:
= {
.done = frame_handle_done,
}

Definition at line 671 of file wl.c.

◆ layer_surface_listener

const struct zwlr_layer_surface_v1_listener layer_surface_listener
static
Initial value:
= {
.configure = layer_surface_handle_configure,
.closed = layer_surface_handle_closed,
}

Definition at line 168 of file wl.c.

◆ registry_listener

const struct wl_registry_listener registry_listener
static
Initial value:
= {
.global = handle_global,
.global_remove = handle_global_remove,
}

Definition at line 288 of file wl.c.

◆ surface_listener

const struct wl_surface_listener surface_listener
static
Initial value:
= {
.enter = surface_handle_enter,
.leave = surface_handle_leave,
}

Definition at line 64 of file wl.c.

◆ xdg_surface_listener

const struct xdg_surface_listener xdg_surface_listener
static
Initial value:
= {
.configure = xdg_surface_handle_configure,
}

Definition at line 177 of file wl.c.

◆ xdg_toplevel_listener

const struct xdg_toplevel_listener xdg_toplevel_listener
static
Initial value:
= {
.configure = xdg_toplevel_handle_configure,
.close = xdg_toplevel_handle_close,
}

Definition at line 181 of file wl.c.

◆ xdg_wm_base_listener

const struct xdg_wm_base_listener xdg_wm_base_listener
static
Initial value:
= {
.ping = xdg_wm_base_handle_ping,
}

Definition at line 173 of file wl.c.