mirror of
https://github.com/swaywm/sway.git
synced 2025-10-31 22:25:26 -04:00
commit
2f6dd0687b
15 changed files with 550 additions and 346 deletions
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include <wlc/wlc.h>
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
#include "list.h"
|
||||
|
||||
struct sway_variable {
|
||||
|
|
@ -32,16 +33,17 @@ struct sway_config {
|
|||
list_t *cmd_queue;
|
||||
list_t *workspace_outputs;
|
||||
struct sway_mode *current_mode;
|
||||
uint32_t floating_mod;
|
||||
|
||||
// Flags
|
||||
bool focus_follows_mouse;
|
||||
bool mouse_warping;
|
||||
bool active;
|
||||
bool failed;
|
||||
bool active;
|
||||
bool failed;
|
||||
bool reloading;
|
||||
};
|
||||
|
||||
bool load_config();
|
||||
bool load_config(void);
|
||||
bool read_config(FILE *file, bool is_active);
|
||||
char *do_var_replacement(struct sway_config *config, char *str);
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ struct sway_container {
|
|||
|
||||
bool is_floating;
|
||||
|
||||
bool is_focused;
|
||||
|
||||
int weight;
|
||||
|
||||
char *name;
|
||||
|
|
|
|||
36
include/focus.h
Normal file
36
include/focus.h
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#ifndef _SWAY_FOCUS_H
|
||||
#define _SWAY_FOCUS_H
|
||||
#include "container.h"
|
||||
|
||||
enum movement_direction {
|
||||
MOVE_LEFT,
|
||||
MOVE_RIGHT,
|
||||
MOVE_UP,
|
||||
MOVE_DOWN,
|
||||
MOVE_PARENT
|
||||
};
|
||||
|
||||
//focused_container - the container found by following the `focused` pointer
|
||||
//from a given container to a container with `is_focused` boolean set
|
||||
//---
|
||||
//focused_view - the container found by following the `focused` pointer from a
|
||||
//given container to a view.
|
||||
//---
|
||||
|
||||
swayc_t *get_focused_container(swayc_t *parent);
|
||||
swayc_t *get_focused_view(swayc_t *parent);
|
||||
|
||||
void set_focused_container(swayc_t *container);
|
||||
void set_focused_container_for(swayc_t *ancestor, swayc_t *container);
|
||||
|
||||
//lock focused container/view. locked by windows with OVERRIDE attribute
|
||||
//and unlocked when they are destroyed
|
||||
|
||||
extern bool locked_container_focus;
|
||||
extern bool locked_view_focus;
|
||||
|
||||
|
||||
bool move_focus(enum movement_direction direction);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,12 +1,13 @@
|
|||
#ifndef _SWAY_HANDLERS_H
|
||||
#define _SWAY_HANDLERS_H
|
||||
|
||||
#include "container.h"
|
||||
#include <stdbool.h>
|
||||
#include <wlc/wlc.h>
|
||||
|
||||
extern struct wlc_interface interface;
|
||||
extern uint32_t keys_pressed[32];
|
||||
|
||||
//set focus to current pointer location and return focused container
|
||||
swayc_t *focus_pointer(void);
|
||||
swayc_t *container_under_pointer(void);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ void add_child(swayc_t *parent, swayc_t *child);
|
|||
//Returns parent container which needs to be rearranged.
|
||||
swayc_t *add_sibling(swayc_t *sibling, swayc_t *child);
|
||||
swayc_t *replace_child(swayc_t *child, swayc_t *new_child);
|
||||
swayc_t *remove_child(swayc_t *parent, swayc_t *child);
|
||||
swayc_t *remove_child(swayc_t *child);
|
||||
|
||||
//Layout
|
||||
void arrange_windows(swayc_t *container, int width, int height);
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
#ifndef _SWAY_MOVEMENT_H
|
||||
#define _SWAY_MOVEMENT_H
|
||||
|
||||
#include <wlc/wlc.h>
|
||||
#include "list.h"
|
||||
|
||||
enum movement_direction {
|
||||
MOVE_LEFT,
|
||||
MOVE_RIGHT,
|
||||
MOVE_UP,
|
||||
MOVE_DOWN,
|
||||
MOVE_PARENT
|
||||
};
|
||||
|
||||
bool move_focus(enum movement_direction direction);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue