rofi 2.0.0
display.c File Reference
#include <config.h>
#include <errno.h>
#include <fcntl.h>
#include <locale.h>
#include <math.h>
#include <stdint.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <unistd.h>
#include <cairo.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <wayland-client.h>
#include <wayland-cursor.h>
#include <xkbcommon/xkbcommon-compose.h>
#include <xkbcommon/xkbcommon.h>
#include <libgwater-wayland.h>
#include <nkutils-bindings.h>
#include <rofi.h>
#include "input-codes.h"
#include "keyb.h"
#include "rofi-types.h"
#include "settings.h"
#include "view.h"
#include "display-internal.h"
#include "display.h"
#include "wayland-internal.h"
#include "keyboard-shortcuts-inhibit-unstable-v1-protocol.h"
#include "primary-selection-unstable-v1-protocol.h"
#include "wlr-layer-shell-unstable-v1-protocol.h"
Include dependency graph for display.c:

Go to the source code of this file.

Data Structures

struct  wayland_output
struct  wayland_buffer
struct  _display_buffer_pool
struct  clipboard_read_info

Macros

#define G_LOG_DOMAIN   "Wayland"
#define wayland_output_get_dpi(output, scale, dimension)
#define CLIPBOARD_READ_INCREMENT   1024

Typedefs

typedef struct _display_buffer_pool wayland_buffer_pool

Functions

static gboolean wayland_display_late_setup (void)
static void wayland_buffer_cleanup (wayland_buffer_pool *self)
static void wayland_buffer_release (void *data, struct wl_buffer *buffer)
wayland_buffer_pooldisplay_buffer_pool_new (gint width, gint height)
void display_buffer_pool_free (wayland_buffer_pool *self)
static void wayland_surface_protocol_enter (void *data, struct wl_surface *wl_surface, struct wl_output *wl_output)
static void wayland_surface_protocol_leave (void *data, struct wl_surface *wl_surface, struct wl_output *wl_output)
static void wayland_frame_callback (void *data, struct wl_callback *callback, uint32_t time)
cairo_surface_t * display_buffer_pool_get_next_buffer (wayland_buffer_pool *pool)
void display_surface_commit (cairo_surface_t *surface)
static void wayland_keyboard_keymap (void *data, struct wl_keyboard *keyboard, enum wl_keyboard_keymap_format format, int32_t fd, uint32_t size)
static void wayland_keyboard_enter (void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface, struct wl_array *keys)
static void wayland_keyboard_leave (void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface)
static gboolean wayland_key_repeat (void *data)
static gboolean wayland_key_repeat_delay (void *data)
static void wayland_keyboard_key (void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t time, uint32_t key, enum wl_keyboard_key_state kstate)
static void wayland_keyboard_modifiers (void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group)
static void wayland_keyboard_repeat_info (void *data, struct wl_keyboard *keyboard, int32_t rate, int32_t delay)
static gboolean wayland_cursor_reload_theme (guint scale)
static void wayland_cursor_set_image (int i)
static void wayland_cursor_frame_callback (void *data, struct wl_callback *callback, uint32_t time)
static void wayland_pointer_send_events (wayland_seat *self)
static struct wl_cursor * rofi_cursor_type_to_wl_cursor (struct wl_cursor_theme *theme, RofiCursorType type)
static void wayland_cursor_update_for_seat (wayland_seat *seat)
static void wayland_pointer_enter (void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y)
void wayland_display_set_cursor_type (RofiCursorType type)
static void wayland_pointer_leave (void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface)
static void wayland_pointer_motion (void *data, struct wl_pointer *pointer, uint32_t time, wl_fixed_t x, wl_fixed_t y)
static void wayland_pointer_button (void *data, struct wl_pointer *pointer, uint32_t serial, uint32_t time, uint32_t button, enum wl_pointer_button_state state)
static void wayland_pointer_axis (void *data, struct wl_pointer *pointer, uint32_t time, enum wl_pointer_axis axis, wl_fixed_t value)
static void wayland_pointer_frame (void *data, struct wl_pointer *pointer)
static void wayland_pointer_axis_source (void *data, struct wl_pointer *pointer, enum wl_pointer_axis_source axis_source)
static void wayland_pointer_axis_stop (void *data, struct wl_pointer *pointer, uint32_t time, enum wl_pointer_axis axis)
static void wayland_pointer_axis_discrete (void *data, struct wl_pointer *pointer, enum wl_pointer_axis axis, int32_t discrete)
static void wayland_keyboard_release (wayland_seat *self)
static gboolean clipboard_read_glib_callback (GIOChannel *channel, GIOCondition condition, gpointer opaque)
static gboolean clipboard_read_data (int fd, ClipboardCb callback, void *user_data)
static void data_offer_handle_offer (void *data, struct wl_data_offer *offer, const char *mime_type)
static void data_offer_handle_source_actions (void *data, struct wl_data_offer *wl_data_offer, uint32_t source_actions)
static void data_offer_handle_action (void *data, struct wl_data_offer *wl_data_offer, uint32_t dnd_action)
static void data_device_handle_data_offer (void *data, struct wl_data_device *data_device, struct wl_data_offer *offer)
static void data_device_handle_enter (void *data, struct wl_data_device *wl_data_device, uint32_t serial, struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct wl_data_offer *id)
static void data_device_handle_leave (void *data, struct wl_data_device *wl_data_device)
static void data_device_handle_motion (void *data, struct wl_data_device *wl_data_device, uint32_t time, wl_fixed_t x, wl_fixed_t y)
static void data_device_handle_drop (void *data, struct wl_data_device *wl_data_device)
static void clipboard_handle_selection (enum clipboard_type cb_type, void *offer)
static void data_device_handle_selection (void *data, struct wl_data_device *data_device, struct wl_data_offer *offer)
static void primary_selection_handle_offer (void *data, struct zwp_primary_selection_offer_v1 *offer, const char *mime_type)
static void primary_selection_device_handle_data_offer (void *data, struct zwp_primary_selection_device_v1 *data_device, struct zwp_primary_selection_offer_v1 *offer)
static void primary_selection_device_handle_selection (void *data, struct zwp_primary_selection_device_v1 *data_device, struct zwp_primary_selection_offer_v1 *offer)
static void wayland_pointer_release (wayland_seat *self)
static void wayland_seat_release (wayland_seat *self)
static void wayland_seat_capabilities (void *data, struct wl_seat *seat, uint32_t capabilities)
static void wayland_seat_name (void *data, struct wl_seat *seat, const char *name)
static void wayland_output_release (wayland_output *self)
static wayland_outputwayland_output_by_name (const char *name)
double wayland_get_dpi_estimation (void)
static void wayland_output_done (void *data, struct wl_output *output)
static void wayland_output_geometry (void *data, struct wl_output *output, int32_t x, int32_t y, int32_t width, int32_t height, int32_t subpixel, const char *make, const char *model, int32_t transform)
static void wayland_output_mode (void *data, struct wl_output *output, enum wl_output_mode flags, int32_t width, int32_t height, int32_t refresh)
static void wayland_output_scale (void *data, struct wl_output *output, int32_t scale)
static void wayland_registry_handle_global (void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version)
static void wayland_registry_handle_global_remove (void *data, struct wl_registry *registry, uint32_t name)
static void wayland_layer_shell_surface_configure (void *data, struct zwlr_layer_surface_v1 *surface, uint32_t serial, uint32_t width, uint32_t height)
static void wayland_surface_destroy (void)
static void wayland_layer_shell_surface_closed (void *data, struct zwlr_layer_surface_v1 *surface)
static gboolean wayland_error (gpointer user_data)
static gboolean wayland_display_setup (GMainLoop *main_loop, NkBindings *bindings)
gboolean display_get_surface_dimensions (int *width, int *height)
void display_set_surface_dimensions (int width, int height, int x_margin, int y_margin, int loc)
static void wayland_display_early_cleanup (void)
static void wayland_display_cleanup (void)
static void wayland_display_dump_monitor_layout (void)
static void wayland_display_startup_notification (RofiHelperExecuteContext *context, GSpawnChildSetupFunc *child_setup, gpointer *user_data)
static int wayland_display_monitor_active (workarea *mon)
static void wayland_display_set_input_focus (guint w)
static void wayland_display_revert_input_focus (void)
static const struct _view_proxywayland_display_view_proxy (void)
static guint wayland_display_scale (void)
static void wayland_get_clipboard_data (int cb_type, ClipboardCb callback, void *user_data)
static void wayland_set_fullscreen_mode (void)

Variables

static wayland_stuff wayland_
wayland_stuffwayland = &wayland_
static const cairo_user_data_key_t wayland_cairo_surface_user_data
static const struct wl_buffer_listener wayland_buffer_listener
static const struct wl_surface_listener wayland_surface_interface
static const struct wl_callback_listener wayland_frame_wl_callback_listener
static const struct wl_keyboard_listener wayland_keyboard_listener
static const struct wl_callback_listener wayland_cursor_frame_wl_callback_listener
static const struct wl_pointer_listener wayland_pointer_listener
static const struct wl_data_offer_listener data_offer_listener
static const struct wl_data_device_listener data_device_listener
static const struct zwp_primary_selection_offer_v1_listener primary_selection_offer_listener
static const struct zwp_primary_selection_device_v1_listener primary_selection_device_listener
static const struct wl_seat_listener wayland_seat_listener
static const struct wl_output_listener wayland_output_listener
static const struct wl_registry_listener wayland_registry_listener
static const struct zwlr_layer_surface_v1_listener wayland_layer_shell_surface_listener
static display_proxy display_
display_proxy *const wayland_proxy = &display_

Macro Definition Documentation

◆ CLIPBOARD_READ_INCREMENT

#define CLIPBOARD_READ_INCREMENT   1024

Definition at line 913 of file display.c.

Referenced by clipboard_read_data(), and clipboard_read_glib_callback().

◆ G_LOG_DOMAIN

#define G_LOG_DOMAIN   "Wayland"

MIT/X11 License Modified (c) 2017 Morgane Glidic, (c) 2020-2025 lbonn, (c) 2025 lvitals

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Definition at line 25 of file display.c.

◆ wayland_output_get_dpi

#define wayland_output_get_dpi ( output,
scale,
dimension )
Value:
((output)->current.physical_##dimension > 0 && (scale) > 0 \
? round((double)(output)->current.dimension * 25.4 / (scale) / \
(output)->current.physical_##dimension) \
: 0)

Definition at line 70 of file display.c.

Referenced by wayland_display_dump_monitor_layout(), wayland_get_dpi_estimation(), and wayland_surface_protocol_enter().

Typedef Documentation

◆ wayland_buffer_pool

Definition at line 76 of file display.c.

Function Documentation

◆ clipboard_handle_selection()

void clipboard_handle_selection ( enum clipboard_type cb_type,
void * offer )
static

Definition at line 1035 of file display.c.

References CLIPBOARD_DEFAULT, clipboard_data::offer, and wayland.

Referenced by data_device_handle_selection(), and primary_selection_device_handle_selection().

Here is the caller graph for this function:

◆ clipboard_read_data()

gboolean clipboard_read_data ( int fd,
ClipboardCb callback,
void * user_data )
static

Definition at line 966 of file display.c.

References clipboard_read_info::buffer, clipboard_read_info::callback, clipboard_read_glib_callback(), CLIPBOARD_READ_INCREMENT, clipboard_read_info::fd, clipboard_read_info::size, and clipboard_read_info::user_data.

Referenced by wayland_get_clipboard_data().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clipboard_read_glib_callback()

gboolean clipboard_read_glib_callback ( GIOChannel * channel,
GIOCondition condition,
gpointer opaque )
static

◆ data_device_handle_data_offer()

void data_device_handle_data_offer ( void * data,
struct wl_data_device * data_device,
struct wl_data_offer * offer )
static

Definition at line 1012 of file display.c.

References data_offer_listener.

◆ data_device_handle_drop()

void data_device_handle_drop ( void * data,
struct wl_data_device * wl_data_device )
static

Definition at line 1032 of file display.c.

◆ data_device_handle_enter()

void data_device_handle_enter ( void * data,
struct wl_data_device * wl_data_device,
uint32_t serial,
struct wl_surface * surface,
wl_fixed_t x,
wl_fixed_t y,
struct wl_data_offer * id )
static

Definition at line 1018 of file display.c.

◆ data_device_handle_leave()

void data_device_handle_leave ( void * data,
struct wl_data_device * wl_data_device )
static

Definition at line 1024 of file display.c.

◆ data_device_handle_motion()

void data_device_handle_motion ( void * data,
struct wl_data_device * wl_data_device,
uint32_t time,
wl_fixed_t x,
wl_fixed_t y )
static

Definition at line 1027 of file display.c.

References time.

◆ data_device_handle_selection()

void data_device_handle_selection ( void * data,
struct wl_data_device * data_device,
struct wl_data_offer * offer )
static

Definition at line 1049 of file display.c.

References CLIPBOARD_DEFAULT, and clipboard_handle_selection().

Here is the call graph for this function:

◆ data_offer_handle_action()

void data_offer_handle_action ( void * data,
struct wl_data_offer * wl_data_offer,
uint32_t dnd_action )
static

Definition at line 1002 of file display.c.

◆ data_offer_handle_offer()

void data_offer_handle_offer ( void * data,
struct wl_data_offer * offer,
const char * mime_type )
static

Definition at line 996 of file display.c.

◆ data_offer_handle_source_actions()

void data_offer_handle_source_actions ( void * data,
struct wl_data_offer * wl_data_offer,
uint32_t source_actions )
static

Definition at line 999 of file display.c.

◆ display_buffer_pool_free()

void display_buffer_pool_free ( wayland_buffer_pool * self)

Definition at line 227 of file display.c.

References _display_buffer_pool::to_free, and wayland_buffer_cleanup().

Referenced by wayland_rofi_view_pool_refresh().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ display_buffer_pool_get_next_buffer()

cairo_surface_t * display_buffer_pool_get_next_buffer ( wayland_buffer_pool * pool)

◆ display_buffer_pool_new()

wayland_buffer_pool * display_buffer_pool_new ( gint width,
gint height )

◆ display_get_surface_dimensions()

gboolean display_get_surface_dimensions ( int * width,
int * height )

Definition at line 1652 of file display.c.

References wayland.

Referenced by wayland_rofi_view_calculate_window_height(), wayland_rofi_view_calculate_window_width(), and wayland_rofi_view_get_current_monitor().

Here is the caller graph for this function:

◆ display_set_surface_dimensions()

void display_set_surface_dimensions ( int width,
int height,
int x_margin,
int y_margin,
int loc )

Definition at line 1665 of file display.c.

References wayland, WL_CENTER, WL_EAST, WL_NORTH, WL_NORTH_EAST, WL_NORTH_WEST, WL_SOUTH, WL_SOUTH_EAST, WL_SOUTH_WEST, and WL_WEST.

Referenced by wayland_rofi_view_window_update_size().

Here is the caller graph for this function:

◆ display_surface_commit()

void display_surface_commit ( cairo_surface_t * surface)

◆ primary_selection_device_handle_data_offer()

void primary_selection_device_handle_data_offer ( void * data,
struct zwp_primary_selection_device_v1 * data_device,
struct zwp_primary_selection_offer_v1 * offer )
static

Definition at line 1074 of file display.c.

References primary_selection_offer_listener.

◆ primary_selection_device_handle_selection()

void primary_selection_device_handle_selection ( void * data,
struct zwp_primary_selection_device_v1 * data_device,
struct zwp_primary_selection_offer_v1 * offer )
static

Definition at line 1081 of file display.c.

References clipboard_handle_selection(), and CLIPBOARD_PRIMARY.

Here is the call graph for this function:

◆ primary_selection_handle_offer()

void primary_selection_handle_offer ( void * data,
struct zwp_primary_selection_offer_v1 * offer,
const char * mime_type )
static

Definition at line 1065 of file display.c.

◆ rofi_cursor_type_to_wl_cursor()

struct wl_cursor * rofi_cursor_type_to_wl_cursor ( struct wl_cursor_theme * theme,
RofiCursorType type )
static

Definition at line 654 of file display.c.

References ROFI_CURSOR_POINTER, and ROFI_CURSOR_TEXT.

Referenced by wayland_cursor_reload_theme(), and wayland_display_set_cursor_type().

Here is the caller graph for this function:

◆ wayland_buffer_cleanup()

void wayland_buffer_cleanup ( wayland_buffer_pool * self)
static

◆ wayland_buffer_release()

void wayland_buffer_release ( void * data,
struct wl_buffer * buffer )
static

Definition at line 141 of file display.c.

References wayland_buffer::buffer, _display_buffer_pool::buffers, wayland_buffer::released, wayland, and wayland_buffer_cleanup().

Here is the call graph for this function:

◆ wayland_cursor_frame_callback()

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

Definition at line 558 of file display.c.

References time, wayland, wayland_cursor_frame_wl_callback_listener, and wayland_cursor_set_image().

Referenced by wayland_cursor_update_for_seat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wayland_cursor_reload_theme()

gboolean wayland_cursor_reload_theme ( guint scale)
static

Definition at line 1521 of file display.c.

References rofi_cursor_type_to_wl_cursor(), and wayland.

Referenced by wayland_pointer_enter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wayland_cursor_set_image()

void wayland_cursor_set_image ( int i)
static

Definition at line 535 of file display.c.

References wayland.

Referenced by wayland_cursor_frame_callback(), and wayland_cursor_update_for_seat().

Here is the caller graph for this function:

◆ wayland_cursor_update_for_seat()

void wayland_cursor_update_for_seat ( wayland_seat * seat)
static

Definition at line 695 of file display.c.

References _wayland_seat::pointer, _wayland_seat::pointer_serial, wayland, wayland_cursor_frame_callback(), and wayland_cursor_set_image().

Referenced by wayland_display_set_cursor_type(), and wayland_pointer_enter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wayland_display_cleanup()

void wayland_display_cleanup ( void )
static

Definition at line 1735 of file display.c.

References wayland.

◆ wayland_display_dump_monitor_layout()

◆ wayland_display_early_cleanup()

void wayland_display_early_cleanup ( void )
static

Definition at line 1726 of file display.c.

References wayland, and wayland_surface_destroy().

Here is the call graph for this function:

◆ wayland_display_late_setup()

gboolean wayland_display_late_setup ( void )
static

Definition at line 1606 of file display.c.

References config, wayland_output::output, _wayland_seat::seat, wayland, wayland_frame_callback(), wayland_layer_shell_surface_listener, wayland_output_by_name(), and wayland_surface_interface.

Referenced by wayland_layer_shell_surface_closed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wayland_display_monitor_active()

int wayland_display_monitor_active ( workarea * mon)
static

Definition at line 1789 of file display.c.

References mon.

◆ wayland_display_revert_input_focus()

void wayland_display_revert_input_focus ( void )
static

Definition at line 1796 of file display.c.

◆ wayland_display_scale()

guint wayland_display_scale ( void )
static

Definition at line 1802 of file display.c.

References wayland.

◆ wayland_display_set_cursor_type()

void wayland_display_set_cursor_type ( RofiCursorType type)

Definition at line 746 of file display.c.

References _wayland_seat::pointer, rofi_cursor_type_to_wl_cursor(), wayland, and wayland_cursor_update_for_seat().

Here is the call graph for this function:

◆ wayland_display_set_input_focus()

void wayland_display_set_input_focus ( guint w)
static

Definition at line 1794 of file display.c.

◆ wayland_display_setup()

gboolean wayland_display_setup ( GMainLoop * main_loop,
NkBindings * bindings )
static

Definition at line 1558 of file display.c.

References bindings, main_loop, ROFI_CURSOR_DEFAULT, wayland, wayland_error(), and wayland_registry_listener.

Here is the call graph for this function:

◆ wayland_display_startup_notification()

void wayland_display_startup_notification ( RofiHelperExecuteContext * context,
GSpawnChildSetupFunc * child_setup,
gpointer * user_data )
static

Definition at line 1785 of file display.c.

◆ wayland_display_view_proxy()

const struct _view_proxy * wayland_display_view_proxy ( void )
static

Definition at line 1798 of file display.c.

References wayland_view_proxy.

◆ wayland_error()

gboolean wayland_error ( gpointer user_data)
static

Definition at line 1516 of file display.c.

References wayland.

Referenced by wayland_display_setup().

Here is the caller graph for this function:

◆ wayland_frame_callback()

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

Definition at line 326 of file display.c.

References rofi_view_frame_callback(), wayland, and wayland_frame_wl_callback_listener.

Referenced by wayland_display_late_setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wayland_get_clipboard_data()

void wayland_get_clipboard_data ( int cb_type,
ClipboardCb callback,
void * user_data )
static

Definition at line 1804 of file display.c.

References CLIPBOARD_DEFAULT, clipboard_read_data(), clipboard_data::offer, and wayland.

Here is the call graph for this function:

◆ wayland_get_dpi_estimation()

double wayland_get_dpi_estimation ( void )

Tries to guess the DPI.

Returns
an guess for the dpi, or -1 if no guess could be made.

Definition at line 1207 of file display.c.

References config, wayland_output::current, wayland_output::scale, wayland, wayland_output_by_name(), and wayland_output_get_dpi.

Referenced by wayland___create_window().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wayland_key_repeat()

gboolean wayland_key_repeat ( void * data)
static

Definition at line 394 of file display.c.

References _wayland_seat::key, _wayland_seat::repeat, rofi_view_get_active(), rofi_view_handle_text(), rofi_view_maybe_update(), _wayland_seat::source, and wayland.

Referenced by wayland_key_repeat_delay().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wayland_key_repeat_delay()

gboolean wayland_key_repeat_delay ( void * data)
static

Definition at line 420 of file display.c.

References _wayland_seat::key, _wayland_seat::rate, _wayland_seat::repeat, rofi_view_get_active(), rofi_view_handle_text(), rofi_view_maybe_update(), _wayland_seat::source, wayland, and wayland_key_repeat().

Referenced by wayland_keyboard_key().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wayland_keyboard_enter()

void wayland_keyboard_enter ( void * data,
struct wl_keyboard * keyboard,
uint32_t serial,
struct wl_surface * surface,
struct wl_array * keys )
static

Definition at line 371 of file display.c.

References _wayland_seat::serial, and wayland.

◆ wayland_keyboard_key()

void wayland_keyboard_key ( void * data,
struct wl_keyboard * keyboard,
uint32_t serial,
uint32_t time,
uint32_t key,
enum wl_keyboard_key_state kstate )
static

◆ wayland_keyboard_keymap()

void wayland_keyboard_keymap ( void * data,
struct wl_keyboard * keyboard,
enum wl_keyboard_keymap_format format,
int32_t fd,
uint32_t size )
static

Definition at line 340 of file display.c.

References wayland.

◆ wayland_keyboard_leave()

void wayland_keyboard_leave ( void * data,
struct wl_keyboard * keyboard,
uint32_t serial,
struct wl_surface * surface )
static

Definition at line 387 of file display.c.

◆ wayland_keyboard_modifiers()

void wayland_keyboard_modifiers ( void * data,
struct wl_keyboard * keyboard,
uint32_t serial,
uint32_t mods_depressed,
uint32_t mods_latched,
uint32_t mods_locked,
uint32_t group )
static

Definition at line 497 of file display.c.

References rofi_view_get_active(), rofi_view_maybe_update(), and wayland.

Here is the call graph for this function:

◆ wayland_keyboard_release()

void wayland_keyboard_release ( wayland_seat * self)
static

Definition at line 897 of file display.c.

References _wayland_seat::key, _wayland_seat::keyboard, _wayland_seat::repeat, and _wayland_seat::source.

Referenced by wayland_seat_capabilities(), and wayland_seat_release().

Here is the caller graph for this function:

◆ wayland_keyboard_repeat_info()

void wayland_keyboard_repeat_info ( void * data,
struct wl_keyboard * keyboard,
int32_t rate,
int32_t delay )
static

◆ wayland_layer_shell_surface_closed()

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

Definition at line 1489 of file display.c.

References rofi_view_get_active(), rofi_view_pool_refresh(), rofi_view_set_size(), wayland_display_late_setup(), and wayland_surface_destroy().

Here is the call graph for this function:

◆ wayland_layer_shell_surface_configure()

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

Definition at line 1469 of file display.c.

References wayland.

◆ wayland_output_by_name()

wayland_output * wayland_output_by_name ( const char * name)
static

Definition at line 1189 of file display.c.

References wayland_output::name, and wayland.

Referenced by wayland_display_late_setup(), and wayland_get_dpi_estimation().

Here is the caller graph for this function:

◆ wayland_output_done()

◆ wayland_output_geometry()

void wayland_output_geometry ( void * data,
struct wl_output * output,
int32_t x,
int32_t y,
int32_t width,
int32_t height,
int32_t subpixel,
const char * make,
const char * model,
int32_t transform )
static

◆ wayland_output_mode()

void wayland_output_mode ( void * data,
struct wl_output * output,
enum wl_output_mode flags,
int32_t width,
int32_t height,
int32_t refresh )
static

◆ wayland_output_release()

void wayland_output_release ( wayland_output * self)
static

Definition at line 1174 of file display.c.

References wayland_output::name, wayland_output::output, and wayland.

Referenced by wayland_registry_handle_global_remove().

Here is the caller graph for this function:

◆ wayland_output_scale()

void wayland_output_scale ( void * data,
struct wl_output * output,
int32_t scale )
static

Definition at line 1267 of file display.c.

References wayland_output::pending, and wayland_output::scale.

◆ wayland_pointer_axis()

void wayland_pointer_axis ( void * data,
struct wl_pointer * pointer,
uint32_t time,
enum wl_pointer_axis axis,
wl_fixed_t value )
static

◆ wayland_pointer_axis_discrete()

void wayland_pointer_axis_discrete ( void * data,
struct wl_pointer * pointer,
enum wl_pointer_axis axis,
int32_t discrete )
static

◆ wayland_pointer_axis_source()

void wayland_pointer_axis_source ( void * data,
struct wl_pointer * pointer,
enum wl_pointer_axis_source axis_source )
static

Definition at line 836 of file display.c.

References _wayland_seat::axis_source.

◆ wayland_pointer_axis_stop()

void wayland_pointer_axis_stop ( void * data,
struct wl_pointer * pointer,
uint32_t time,
enum wl_pointer_axis axis )
static

Definition at line 843 of file display.c.

References time.

◆ wayland_pointer_button()

void wayland_pointer_button ( void * data,
struct wl_pointer * pointer,
uint32_t serial,
uint32_t time,
uint32_t button,
enum wl_pointer_button_state state )
static

◆ wayland_pointer_enter()

void wayland_pointer_enter ( void * data,
struct wl_pointer * pointer,
uint32_t serial,
struct wl_surface * surface,
wl_fixed_t x,
wl_fixed_t y )
static

Definition at line 724 of file display.c.

References _wayland_seat::pointer_serial, wayland, wayland_cursor_reload_theme(), and wayland_cursor_update_for_seat().

Here is the call graph for this function:

◆ wayland_pointer_frame()

void wayland_pointer_frame ( void * data,
struct wl_pointer * pointer )
static

Definition at line 830 of file display.c.

References wayland_pointer_send_events().

Here is the call graph for this function:

◆ wayland_pointer_leave()

void wayland_pointer_leave ( void * data,
struct wl_pointer * pointer,
uint32_t serial,
struct wl_surface * surface )
static

Definition at line 780 of file display.c.

References wayland.

◆ wayland_pointer_motion()

void wayland_pointer_motion ( void * data,
struct wl_pointer * pointer,
uint32_t time,
wl_fixed_t x,
wl_fixed_t y )
static

◆ wayland_pointer_release()

void wayland_pointer_release ( wayland_seat * self)
static

Definition at line 1093 of file display.c.

References _wayland_seat::pointer.

Referenced by wayland_seat_capabilities(), and wayland_seat_release().

Here is the caller graph for this function:

◆ wayland_pointer_send_events()

◆ wayland_registry_handle_global()

◆ wayland_registry_handle_global_remove()

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

◆ wayland_seat_capabilities()

void wayland_seat_capabilities ( void * data,
struct wl_seat * seat,
uint32_t capabilities )
static

◆ wayland_seat_name()

void wayland_seat_name ( void * data,
struct wl_seat * seat,
const char * name )
static

Definition at line 1158 of file display.c.

References _wayland_seat::name, and wayland.

◆ wayland_seat_release()

void wayland_seat_release ( wayland_seat * self)
static

Definition at line 1110 of file display.c.

References _wayland_seat::seat, wayland, wayland_keyboard_release(), and wayland_pointer_release().

Referenced by wayland_registry_handle_global_remove().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wayland_set_fullscreen_mode()

void wayland_set_fullscreen_mode ( void )
static

Definition at line 1828 of file display.c.

References rofi_view_pool_refresh(), and wayland.

Here is the call graph for this function:

◆ wayland_surface_destroy()

void wayland_surface_destroy ( void )
static

Definition at line 1477 of file display.c.

References wayland.

Referenced by wayland_display_early_cleanup(), and wayland_layer_shell_surface_closed().

Here is the caller graph for this function:

◆ wayland_surface_protocol_enter()

void wayland_surface_protocol_enter ( void * data,
struct wl_surface * wl_surface,
struct wl_output * wl_output )
static

◆ wayland_surface_protocol_leave()

void wayland_surface_protocol_leave ( void * data,
struct wl_surface * wl_surface,
struct wl_output * wl_output )
static

Definition at line 266 of file display.c.

Variable Documentation

◆ data_device_listener

const struct wl_data_device_listener data_device_listener
static
Initial value:
= {
}
static void data_device_handle_drop(void *data, struct wl_data_device *wl_data_device)
Definition display.c:1032
static void data_device_handle_selection(void *data, struct wl_data_device *data_device, struct wl_data_offer *offer)
Definition display.c:1049
static void data_device_handle_leave(void *data, struct wl_data_device *wl_data_device)
Definition display.c:1024
static void data_device_handle_motion(void *data, struct wl_data_device *wl_data_device, uint32_t time, wl_fixed_t x, wl_fixed_t y)
Definition display.c:1027
static void data_device_handle_data_offer(void *data, struct wl_data_device *data_device, struct wl_data_offer *offer)
Definition display.c:1012
static void data_device_handle_enter(void *data, struct wl_data_device *wl_data_device, uint32_t serial, struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y, struct wl_data_offer *id)
Definition display.c:1018

Definition at line 1055 of file display.c.

Referenced by wayland_seat_capabilities().

◆ data_offer_listener

const struct wl_data_offer_listener data_offer_listener
static
Initial value:
= {
}
static void data_offer_handle_action(void *data, struct wl_data_offer *wl_data_offer, uint32_t dnd_action)
Definition display.c:1002
static void data_offer_handle_source_actions(void *data, struct wl_data_offer *wl_data_offer, uint32_t source_actions)
Definition display.c:999
static void data_offer_handle_offer(void *data, struct wl_data_offer *offer, const char *mime_type)
Definition display.c:996

Definition at line 1006 of file display.c.

Referenced by data_device_handle_data_offer().

◆ display_

display_proxy display_
static
Initial value:
= {
.dump_monitor_layout = wayland_display_dump_monitor_layout,
.startup_notification = wayland_display_startup_notification,
.monitor_active = wayland_display_monitor_active,
.set_input_focus = wayland_display_set_input_focus,
.revert_input_focus = wayland_display_revert_input_focus,
.get_clipboard_data = wayland_get_clipboard_data,
.set_fullscreen_mode = wayland_set_fullscreen_mode,
}
static void wayland_display_dump_monitor_layout(void)
Definition display.c:1749
static void wayland_display_set_input_focus(guint w)
Definition display.c:1794
static void wayland_display_revert_input_focus(void)
Definition display.c:1796
static void wayland_get_clipboard_data(int cb_type, ClipboardCb callback, void *user_data)
Definition display.c:1804
static void wayland_display_early_cleanup(void)
Definition display.c:1726
static void wayland_display_startup_notification(RofiHelperExecuteContext *context, GSpawnChildSetupFunc *child_setup, gpointer *user_data)
Definition display.c:1785
static guint wayland_display_scale(void)
Definition display.c:1802
static gboolean wayland_display_late_setup(void)
Definition display.c:1606
static void wayland_display_cleanup(void)
Definition display.c:1735
static gboolean wayland_display_setup(GMainLoop *main_loop, NkBindings *bindings)
Definition display.c:1558
static void wayland_set_fullscreen_mode(void)
Definition display.c:1828
static const struct _view_proxy * wayland_display_view_proxy(void)
Definition display.c:1798
static int wayland_display_monitor_active(workarea *mon)
Definition display.c:1789

Definition at line 1840 of file display.c.

◆ primary_selection_device_listener

const struct zwp_primary_selection_device_v1_listener primary_selection_device_listener
static
Initial value:
= {
}
static void primary_selection_device_handle_selection(void *data, struct zwp_primary_selection_device_v1 *data_device, struct zwp_primary_selection_offer_v1 *offer)
Definition display.c:1081
static void primary_selection_device_handle_data_offer(void *data, struct zwp_primary_selection_device_v1 *data_device, struct zwp_primary_selection_offer_v1 *offer)
Definition display.c:1074

Definition at line 1088 of file display.c.

Referenced by wayland_seat_capabilities().

◆ primary_selection_offer_listener

const struct zwp_primary_selection_offer_v1_listener primary_selection_offer_listener
static
Initial value:
= {
}
static void primary_selection_handle_offer(void *data, struct zwp_primary_selection_offer_v1 *offer, const char *mime_type)
Definition display.c:1065

Definition at line 1070 of file display.c.

Referenced by primary_selection_device_handle_data_offer().

◆ wayland

◆ wayland_

wayland_stuff wayland_
static

Definition at line 113 of file display.c.

◆ wayland_buffer_listener

const struct wl_buffer_listener wayland_buffer_listener
static
Initial value:
= {
static void wayland_buffer_release(void *data, struct wl_buffer *buffer)
Definition display.c:141

Definition at line 154 of file display.c.

Referenced by display_buffer_pool_new().

◆ wayland_cairo_surface_user_data

const cairo_user_data_key_t wayland_cairo_surface_user_data
static

Definition at line 115 of file display.c.

Referenced by display_buffer_pool_get_next_buffer(), and display_surface_commit().

◆ wayland_cursor_frame_wl_callback_listener

const struct wl_callback_listener wayland_cursor_frame_wl_callback_listener
static
Initial value:
= {
}
static void wayland_cursor_frame_callback(void *data, struct wl_callback *callback, uint32_t time)
Definition display.c:558

Definition at line 554 of file display.c.

Referenced by wayland_cursor_frame_callback().

◆ wayland_frame_wl_callback_listener

const struct wl_callback_listener wayland_frame_wl_callback_listener
static
Initial value:
= {
}
static void wayland_frame_callback(void *data, struct wl_callback *callback, uint32_t time)
Definition display.c:326

Definition at line 278 of file display.c.

Referenced by wayland_frame_callback().

◆ wayland_keyboard_listener

const struct wl_keyboard_listener wayland_keyboard_listener
static
Initial value:
= {
}
static void wayland_keyboard_key(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t time, uint32_t key, enum wl_keyboard_key_state kstate)
Definition display.c:452
static void wayland_keyboard_modifiers(void *data, struct wl_keyboard *keyboard, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group)
Definition display.c:497
static void wayland_keyboard_keymap(void *data, struct wl_keyboard *keyboard, enum wl_keyboard_keymap_format format, int32_t fd, uint32_t size)
Definition display.c:340
static void wayland_keyboard_leave(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface)
Definition display.c:387
static void wayland_keyboard_repeat_info(void *data, struct wl_keyboard *keyboard, int32_t rate, int32_t delay)
Definition display.c:511
static void wayland_keyboard_enter(void *data, struct wl_keyboard *keyboard, uint32_t serial, struct wl_surface *surface, struct wl_array *keys)
Definition display.c:371

Definition at line 524 of file display.c.

Referenced by wayland_seat_capabilities().

◆ wayland_layer_shell_surface_listener

const struct zwlr_layer_surface_v1_listener wayland_layer_shell_surface_listener
static
Initial value:
= {
}
static void wayland_layer_shell_surface_closed(void *data, struct zwlr_layer_surface_v1 *surface)
Definition display.c:1489
static void wayland_layer_shell_surface_configure(void *data, struct zwlr_layer_surface_v1 *surface, uint32_t serial, uint32_t width, uint32_t height)
Definition display.c:1469

Definition at line 1511 of file display.c.

Referenced by wayland_display_late_setup().

◆ wayland_output_listener

const struct wl_output_listener wayland_output_listener
static
Initial value:
= {
}
static void wayland_output_scale(void *data, struct wl_output *output, int32_t scale)
Definition display.c:1267
static void wayland_output_done(void *data, struct wl_output *output)
Definition display.c:1229
static void wayland_output_geometry(void *data, struct wl_output *output, int32_t x, int32_t y, int32_t width, int32_t height, int32_t subpixel, const char *make, const char *model, int32_t transform)
Definition display.c:1243
static void wayland_output_mode(void *data, struct wl_output *output, enum wl_output_mode flags, int32_t width, int32_t height, int32_t refresh)
Definition display.c:1257

Definition at line 1289 of file display.c.

Referenced by wayland_registry_handle_global().

◆ wayland_pointer_listener

const struct wl_pointer_listener wayland_pointer_listener
static
Initial value:
= {
}
static void wayland_pointer_axis(void *data, struct wl_pointer *pointer, uint32_t time, enum wl_pointer_axis axis, wl_fixed_t value)
Definition display.c:815
static void wayland_pointer_axis_stop(void *data, struct wl_pointer *pointer, uint32_t time, enum wl_pointer_axis axis)
Definition display.c:843
static void wayland_pointer_axis_discrete(void *data, struct wl_pointer *pointer, enum wl_pointer_axis axis, int32_t discrete)
Definition display.c:847
static void wayland_pointer_axis_source(void *data, struct wl_pointer *pointer, enum wl_pointer_axis_source axis_source)
Definition display.c:836
static void wayland_pointer_button(void *data, struct wl_pointer *pointer, uint32_t serial, uint32_t time, uint32_t button, enum wl_pointer_button_state state)
Definition display.c:801
static void wayland_pointer_frame(void *data, struct wl_pointer *pointer)
Definition display.c:830
static void wayland_pointer_leave(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface)
Definition display.c:780
static void wayland_pointer_enter(void *data, struct wl_pointer *pointer, uint32_t serial, struct wl_surface *surface, wl_fixed_t x, wl_fixed_t y)
Definition display.c:724
static void wayland_pointer_motion(void *data, struct wl_pointer *pointer, uint32_t time, wl_fixed_t x, wl_fixed_t y)
Definition display.c:790

Definition at line 882 of file display.c.

Referenced by wayland_seat_capabilities().

◆ wayland_proxy

display_proxy* const wayland_proxy = &display_

Definition at line 1857 of file display.c.

Referenced by main().

◆ wayland_registry_listener

const struct wl_registry_listener wayland_registry_listener
static
Initial value:
= {
}
static void wayland_registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name)
Definition display.c:1382
static void wayland_registry_handle_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version)
Definition display.c:1302

Definition at line 1464 of file display.c.

Referenced by wayland_display_setup().

◆ wayland_seat_listener

const struct wl_seat_listener wayland_seat_listener
static
Initial value:
= {
.capabilities = wayland_seat_capabilities,
}
static void wayland_seat_capabilities(void *data, struct wl_seat *seat, uint32_t capabilities)
Definition display.c:1121
static void wayland_seat_name(void *data, struct wl_seat *seat, const char *name)
Definition display.c:1158

Definition at line 1169 of file display.c.

Referenced by wayland_registry_handle_global().

◆ wayland_surface_interface

const struct wl_surface_listener wayland_surface_interface
static
Initial value:
= {
}
static void wayland_surface_protocol_enter(void *data, struct wl_surface *wl_surface, struct wl_output *wl_output)
Definition display.c:235
static void wayland_surface_protocol_leave(void *data, struct wl_surface *wl_surface, struct wl_output *wl_output)
Definition display.c:266

Definition at line 270 of file display.c.

Referenced by wayland_display_late_setup().