This commit is contained in:
RogueAI 2026-02-03 17:39:33 +05:00 committed by GitHub
commit 15de409f09
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 1493 additions and 12 deletions

View file

@ -2,6 +2,22 @@
#define _SWAY_SERVER_H
#include <stdbool.h>
#include <wayland-server-core.h>
#include <wlr/backend.h>
#include <wlr/render/allocator.h>
#include <wlr/render/wlr_renderer.h>
#include <wlr/types/wlr_compositor.h>
#include <wlr/types/wlr_data_device.h>
#include <wlr/types/wlr_input_method_v2.h>
#include <wlr/types/wlr_foreign_toplevel_management_v1.h>
#include <wlr/types/wlr_layer_shell_v1.h>
#include <wlr/types/wlr_output_management_v1.h>
#include <wlr/types/wlr_output_power_management_v1.h>
#include <wlr/types/wlr_presentation_time.h>
#include <wlr/types/wlr_relative_pointer_v1.h>
#include <wlr/types/wlr_session_lock_v1.h>
#include <wlr/types/wlr_server_decoration.h>
#include <wlr/types/wlr_text_input_v3.h>
#include <wlr/types/wlr_xdg_shell.h>
#include "config.h"
#include "list.h"
#include "sway/desktop/idle_inhibit_v1.h"

View file

@ -33,6 +33,7 @@ struct swaybar {
struct zxdg_output_manager_v1 *xdg_output_manager;
struct wp_cursor_shape_manager_v1 *cursor_shape_manager;
struct wl_shm *shm;
struct xdg_wm_base *wm_base;
struct swaybar_config *config;
struct status_line *status;

View file

@ -15,6 +15,7 @@
struct swaybar;
struct swaybar_output;
struct swaybar_seat;
struct swaybar_pointer {
struct wl_pointer *pointer;
@ -48,8 +49,8 @@ struct swaybar_hotspot {
struct wl_list link; // swaybar_output::hotspots
int x, y, width, height;
enum hotspot_event_handling (*callback)(struct swaybar_output *output,
struct swaybar_hotspot *hotspot, double x, double y, uint32_t button,
bool released, void *data);
struct swaybar_hotspot *hotspot, struct swaybar_seat *seat, uint32_t serial,
double x, double y, uint32_t button, bool released, void *data);
void (*destroy)(void *data);
void *data;
};

View file

@ -0,0 +1,27 @@
#ifndef _SWAYBAR_TRAY_DBUSMENU_H
#define _SWAYBAR_TRAY_DBUSMENU_H
#include "swaybar/bar.h"
#include "swaybar/tray/item.h"
void swaybar_dbusmenu_open(struct swaybar_sni *sni,
struct swaybar_output *output, struct swaybar_seat *seat, uint32_t serial,
int x, int y);
bool dbusmenu_pointer_button(void *data, struct wl_pointer *wl_pointer,
uint32_t serial, uint32_t time_, uint32_t button, uint32_t state);
bool dbusmenu_pointer_motion(struct swaybar_seat *seat, struct wl_pointer *wl_pointer,
uint32_t time_, wl_fixed_t surface_x, wl_fixed_t surface_y);
bool dbusmenu_pointer_enter(void *data, struct wl_pointer *wl_pointer, uint32_t serial,
struct wl_surface *surface, wl_fixed_t surface_x, wl_fixed_t surface_y);
bool dbusmenu_pointer_leave(void *data, struct wl_pointer *wl_pointer, uint32_t serial,
struct wl_surface *surface);
bool dbusmenu_pointer_frame(struct swaybar_seat *data, struct wl_pointer *wl_pointer);
bool dbusmenu_pointer_axis(struct swaybar_seat *data, struct wl_pointer *wl_pointer);
#endif

View file

@ -18,6 +18,7 @@ struct swaybar_pixmap {
struct swaybar_sni_slot {
struct wl_list link; // swaybar_sni::slots
struct swaybar_sni *sni;
int menu_id;
const char *prop;
const char *type;
void *dest;
@ -48,6 +49,7 @@ struct swaybar_sni {
char *icon_theme_path; // non-standard KDE property
struct wl_list slots; // swaybar_sni_slot::link
char **menu_icon_theme_paths;
};
struct swaybar_sni *create_sni(char *id, struct swaybar_tray *tray);

View file

@ -32,6 +32,9 @@ struct swaybar_tray {
list_t *basedirs; // char *
list_t *themes; // struct swaybar_theme *
struct swaybar_dbusmenu *menu;
struct swaybar_dbusmenu_menu *menu_pointer_focus;
};
struct swaybar_tray *create_tray(struct swaybar *bar);