#include <wlr/xwayland.h>
#include <xkbcommon/xkbcommon.h>
+#include "rcxml.h"
+
#define XCURSOR_DEFAULT "left_ptr"
#define XCURSOR_SIZE 24
#define XCURSOR_MOVE "grabbing"
struct wlr_box deco_box(struct view *view, enum deco_part deco_part);
enum deco_part deco_at(struct view *view, double lx, double ly);
+void action(struct server *server, struct keybind *keybind);
+
void dbg_show_one_view(struct view *view);
void dbg_show_views(struct server *server);
--- /dev/null
+#include "labwc.h"
+
+#include <strings.h>
+
+void action(struct server *server, struct keybind *keybind)
+{
+ if (!keybind || !keybind->action)
+ return;
+ if (!strcasecmp(keybind->action, "Exit")) {
+ wl_display_terminate(server->wl_display);
+ } else if (!strcasecmp(keybind->action, "NextWindow")) {
+ server->cycle_view = next_toplevel(view_front_toplevel(server));
+ } else if (!strcasecmp(keybind->action, "Execute")) {
+ if (!fork())
+ execl("/bin/dmenu_run", "/bin/dmenu_run", (void *)NULL);
+ } else if (!strcasecmp(keybind->action, "debug-views")) {
+ dbg_show_views(server);
+ } else {
+ fprintf(stderr, "warn: action (%s) not supported\n",
+ keybind->action);
+ }
+}
void keybind_init()
{
- keybind_add(&rc.keybinds, "A-Escape", "exit");
- keybind_add(&rc.keybinds, "A-Tab", "cycle");
- keybind_add(&rc.keybinds, "A-F3", "exec");
+ keybind_add(&rc.keybinds, "A-Escape", "Exit");
+ keybind_add(&rc.keybinds, "A-Tab", "NextWindow");
+ keybind_add(&rc.keybinds, "A-F3", "Execute");
}
void keybind_print()
#include "labwc.h"
-#include "rcxml.h"
static void keyboard_handle_modifiers(struct wl_listener *listener, void *data)
{
keyboard->server->seat, &keyboard->device->keyboard->modifiers);
}
-static void action(struct server *server, struct keybind *keybind)
-{
- if (!keybind || !keybind->action)
- return;
- if (!strcmp(keybind->action, "exit")) {
- wl_display_terminate(server->wl_display);
- } else if (!strcmp(keybind->action, "cycle")) {
- server->cycle_view = next_toplevel(view_front_toplevel(server));
- } else if (!strcmp(keybind->action, "exec")) {
- if (!fork())
- execl("/bin/dmenu_run", "/bin/dmenu_run", (void *)NULL);
- } else if (!strcmp(keybind->action, "debug-views")) {
- dbg_show_views(server);
- } else {
- fprintf(stderr, "warn: action (%s) not supported\n",
- keybind->action);
- }
-}
-
static bool handle_keybinding(struct server *server, uint32_t modifiers,
xkb_keysym_t sym)
{
#include "labwc.h"
-#include "rcxml.h"
#include "theme.h"
struct server server = { 0 };
labwc_sources = files(
+ 'action.c',
'cursor.c',
'deco.c',
'interactive.c',
#include "labwc.h"
-#include "rcxml.h"
#include "theme.h"
struct draw_data {
#include "labwc.h"
-#include "rcxml.h"
#include <wlr/types/wlr_export_dmabuf_v1.h>
#include <wlr/types/wlr_screencopy_v1.h>
#include "labwc.h"
-#include "rcxml.h"
static bool is_toplevel(struct view *view)
{
#include "labwc.h"
-#include "rcxml.h"
struct xdg_deco {
struct wlr_xdg_toplevel_decoration_v1 *wlr_decoration;