gaps improvements

This commit is contained in:
Nate Symer 2018-07-12 11:51:25 -04:00
parent abcc2ef9eb
commit 8fdf85fee0
128 changed files with 1670 additions and 2718 deletions

View file

@ -13,12 +13,11 @@ enum ipc_command_type {
IPC_GET_MARKS = 5,
IPC_GET_BAR_CONFIG = 6,
IPC_GET_VERSION = 7,
IPC_GET_BINDING_MODES = 8,
IPC_GET_CONFIG = 9,
// sway-specific command types
IPC_GET_INPUTS = 100,
IPC_GET_SEATS = 101,
IPC_GET_CLIPBOARD = 101,
IPC_GET_SEATS = 102,
// Events sent from sway to clients. Events have the highest bits set.
IPC_EVENT_WORKSPACE = ((1<<31) | 0),

View file

@ -24,6 +24,4 @@ int list_seq_find(list_t *list, int compare(const void *item, const void *cmp_to
void list_stable_sort(list_t *list, int compare(const void *a, const void *b));
// swap two elements in a list
void list_swap(list_t *list, int src, int dest);
// move item to end of list
void list_move_to_end(list_t *list, void *item);
#endif

View file

@ -3,19 +3,13 @@
#include <stdbool.h>
#include <wlr/util/log.h>
#ifdef __GNUC__
#define ATTRIB_PRINTF(start, end) __attribute__((format(printf, start, end)))
#else
#define ATTRIB_PRINTF(start, end)
#endif
void _sway_abort(const char *filename, ...) ATTRIB_PRINTF(1, 2);
#define sway_abort(FMT, ...) \
_sway_abort("[%s:%d] " FMT, _wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__)
_sway_abort("[%s:%d] " FMT, wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__)
bool _sway_assert(bool condition, const char* format, ...) ATTRIB_PRINTF(2, 3);
#define sway_assert(COND, FMT, ...) \
_sway_assert(COND, "[%s:%d] %s:" FMT, _wlr_strip_path(__FILE__), __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__)
_sway_assert(COND, "[%s:%d] %s:" FMT, wlr_strip_path(__FILE__), __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__)
void error_handler(int sig);

View file

@ -79,7 +79,7 @@ void free_cmd_results(struct cmd_results *results);
*
* Free the JSON string later on.
*/
char *cmd_results_to_json(struct cmd_results *results);
const char *cmd_results_to_json(struct cmd_results *results);
struct cmd_results *add_color(const char *name,
char *buffer, const char *color);
@ -95,6 +95,7 @@ sway_cmd cmd_client_unfocused;
sway_cmd cmd_client_urgent;
sway_cmd cmd_client_placeholder;
sway_cmd cmd_client_background;
sway_cmd cmd_clipboard;
sway_cmd cmd_commands;
sway_cmd cmd_debuglog;
sway_cmd cmd_default_border;

View file

@ -50,7 +50,6 @@ struct sway_mode {
char *name;
list_t *keysym_bindings;
list_t *keycode_bindings;
bool pango;
};
struct input_config_mapped_from_region {
@ -271,10 +270,11 @@ enum ipc_feature {
IPC_FEATURE_EVENT_WINDOW = 2048,
IPC_FEATURE_EVENT_BINDING = 4096,
IPC_FEATURE_EVENT_INPUT = 8192,
IPC_FEATURE_GET_SEATS = 16384,
IPC_FEATURE_GET_CLIPBOARD = 16384,
IPC_FEATURE_GET_SEATS = 32768,
IPC_FEATURE_ALL_COMMANDS =
1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 16384,
1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 16384 | 32768,
IPC_FEATURE_ALL_EVENTS = 256 | 512 | 1024 | 2048 | 4096 | 8192,
IPC_FEATURE_ALL = IPC_FEATURE_ALL_COMMANDS | IPC_FEATURE_ALL_EVENTS,
@ -340,7 +340,6 @@ struct sway_config {
int gaps_outer;
list_t *config_chain;
const char *current_config_path;
const char *current_config;
enum sway_container_border border;
@ -496,4 +495,7 @@ void config_update_font_height(bool recalculate);
/* Global config singleton. */
extern struct sway_config *config;
/* Config file currently being read */
extern const char *current_config_path;
#endif

View file

@ -1,8 +1,4 @@
#include <wlr/types/wlr_surface.h>
struct sway_container;
void desktop_damage_surface(struct wlr_surface *surface, double lx, double ly,
bool whole);
void desktop_damage_whole_container(struct sway_container *con);

View file

@ -1,28 +0,0 @@
#ifndef _SWAY_DESKTOP_IDLE_INHIBIT_V1_H
#define _SWAY_DESKTOP_IDLE_INHIBIT_V1_H
#include <wlr/types/wlr_idle_inhibit_v1.h>
#include <wlr/types/wlr_idle.h>
#include "sway/server.h"
struct sway_idle_inhibit_manager_v1 {
struct wlr_idle_inhibit_manager_v1 *wlr_manager;
struct wl_listener new_idle_inhibitor_v1;
struct wl_list inhibitors;
struct wlr_idle *idle;
};
struct sway_idle_inhibitor_v1 {
struct sway_idle_inhibit_manager_v1 *manager;
struct sway_view *view;
struct wl_list link;
struct wl_listener destroy;
};
void idle_inhibit_v1_check_active(
struct sway_idle_inhibit_manager_v1 *manager);
struct sway_idle_inhibit_manager_v1 *sway_idle_inhibit_manager_v1_create(
struct wl_display *wl_display, struct wlr_idle *idle);
#endif

View file

@ -9,12 +9,14 @@ struct sway_server;
void ipc_init(struct sway_server *server);
void ipc_terminate(void);
struct sockaddr_un *ipc_user_sockaddr(void);
void ipc_event_workspace(struct sway_container *old,
struct sway_container *new, const char *change);
void ipc_event_window(struct sway_container *window, const char *change);
void ipc_event_barconfig_update(struct bar_config *bar);
void ipc_event_mode(const char *mode, bool pango);
void ipc_event_mode(const char *mode);
#endif

View file

@ -38,16 +38,6 @@ struct sway_output {
} events;
};
/**
* Contains a surface's root geometry information. For instance, when rendering
* a popup, this will contain the parent view's position and size.
*/
struct root_geometry {
double x, y;
int width, height;
float rotation;
};
void output_damage_whole(struct sway_output *output);
void output_damage_surface(struct sway_output *output, double ox, double oy,
@ -64,37 +54,4 @@ void output_damage_whole_container(struct sway_output *output,
struct sway_container *output_by_name(const char *name);
void output_enable(struct sway_output *output);
bool output_has_opaque_lockscreen(struct sway_output *output,
struct sway_seat *seat);
struct sway_container *output_get_active_workspace(struct sway_output *output);
void output_render(struct sway_output *output, struct timespec *when,
pixman_region32_t *damage);
bool output_get_surface_box(struct root_geometry *geo,
struct sway_output *output, struct wlr_surface *surface, int sx, int sy,
struct wlr_box *surface_box);
void output_surface_for_each_surface(struct wlr_surface *surface,
double ox, double oy, struct root_geometry *geo,
wlr_surface_iterator_func_t iterator, void *user_data);
void output_view_for_each_surface(struct sway_view *view,
struct sway_output *output, struct root_geometry *geo,
wlr_surface_iterator_func_t iterator, void *user_data);
void output_layer_for_each_surface(struct wl_list *layer_surfaces,
struct root_geometry *geo, wlr_surface_iterator_func_t iterator,
void *user_data);
void output_unmanaged_for_each_surface(struct wl_list *unmanaged,
struct sway_output *output, struct root_geometry *geo,
wlr_surface_iterator_func_t iterator, void *user_data);
void output_drag_icons_for_each_surface(struct wl_list *drag_icons,
struct sway_output *output, struct root_geometry *geo,
wlr_surface_iterator_func_t iterator, void *user_data);
#endif

View file

@ -23,14 +23,12 @@ struct sway_server {
struct wlr_compositor *compositor;
struct wlr_data_device_manager *data_device_manager;
struct wlr_idle *idle;
struct sway_input_manager *input;
struct wl_listener new_output;
struct wlr_idle *idle;
struct sway_idle_inhibit_manager_v1 *idle_inhibit_manager_v1;
struct wlr_layer_shell *layer_shell;
struct wl_listener layer_shell_surface;
@ -63,7 +61,6 @@ void server_run(struct sway_server *server);
void handle_new_output(struct wl_listener *listener, void *data);
void handle_idle_inhibitor_v1(struct wl_listener *listener, void *data);
void handle_layer_shell_surface(struct wl_listener *listener, void *data);
void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data);
void handle_xdg_shell_surface(struct wl_listener *listener, void *data);

View file

@ -297,10 +297,4 @@ bool container_is_floating(struct sway_container *container);
*/
void container_get_box(struct sway_container *container, struct wlr_box *box);
/**
* Move a floating container to a new layout-local position.
*/
void container_floating_move_to(struct sway_container *con,
double lx, double ly);
#endif

View file

@ -19,33 +19,10 @@ enum auth_state {
AUTH_STATE_INVALID,
};
struct swaylock_colorset {
uint32_t input;
uint32_t cleared;
uint32_t verifying;
uint32_t wrong;
};
struct swaylock_colors {
uint32_t background;
uint32_t bs_highlight;
uint32_t key_highlight;
uint32_t separator;
struct swaylock_colorset inside;
struct swaylock_colorset line;
struct swaylock_colorset ring;
struct swaylock_colorset text;
};
struct swaylock_args {
struct swaylock_colors colors;
uint32_t color;
enum background_mode mode;
char *font;
uint32_t radius;
uint32_t thickness;
bool ignore_empty;
bool show_indicator;
bool daemonize;
};
struct swaylock_password {