mirror of
https://github.com/wizbright/waybox.git
synced 2025-11-24 06:59:52 -05:00
Greek pastries
This commit is contained in:
parent
2af28015c8
commit
f233ac4cc6
47 changed files with 155 additions and 104 deletions
|
|
@ -110,7 +110,6 @@ static bool parse_key_bindings(struct wb_config *config, xmlXPathContextPtr ctxt
|
|||
}
|
||||
if (strcmp((char *) cur_node->name, "execute") == 0)
|
||||
{
|
||||
/* Bad things can happen if the command is greater than 1024 characters */
|
||||
key_bind->cmd = (char *) xmlStrdup(cur_node->children->content);
|
||||
if (key_bind->action)
|
||||
break;
|
||||
|
|
@ -144,7 +143,7 @@ bool init_config(struct wb_server *server) {
|
|||
}
|
||||
|
||||
if (doc == NULL) {
|
||||
wlr_log(WLR_INFO, "%s", _("Unable to parse XML file"));
|
||||
wlr_log(WLR_ERROR, "%s", _("Unable to parse the configuration file. Consult stderr for more information."));
|
||||
return false;
|
||||
}
|
||||
xmlXPathContextPtr ctxt = xmlXPathNewContext(doc);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
/*
|
||||
* More or less taken verbatim from wio <https://git.sr.ht/~sircmpwn/wio>, so in
|
||||
* accordance with its MIT license:
|
||||
*
|
||||
* Copyright 2019 Drew DeVault
|
||||
*/
|
||||
#include <wlr/types/wlr_layer_shell_v1.h>
|
||||
#include "waybox/xdg_shell.h"
|
||||
|
||||
|
|
@ -196,13 +202,7 @@ void arrange_layers(struct wb_output *output) {
|
|||
}
|
||||
}
|
||||
|
||||
/* Focus the topmost layer */
|
||||
if (topmost != NULL)
|
||||
{
|
||||
struct wb_view *view =
|
||||
wl_container_of(output->server->views.next, view, link);
|
||||
focus_view(view, view->xdg_toplevel->base->surface);
|
||||
}
|
||||
/* TODO: Focus topmost layer */
|
||||
}
|
||||
|
||||
static void handle_output_destroy(struct wl_listener *listener, void *data) {
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ int main(int argc, char **argv) {
|
|||
|
||||
struct sigaction sa;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_flags = SA_RESTART;
|
||||
sa.sa_handler = signal_handler;
|
||||
sigaction(SIGINT, &sa, NULL);
|
||||
sigaction(SIGTERM, &sa, NULL);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ static bool cycle_views_reverse(struct wb_server *server) {
|
|||
struct wb_view *next_view = wl_container_of(
|
||||
current_view->link.next, next_view, link);
|
||||
focus_view(next_view, next_view->xdg_toplevel->base->surface);
|
||||
/* Move the previous view to the end of the list */
|
||||
/* Move the current view to after the previous view in the list */
|
||||
wl_list_remove(¤t_view->link);
|
||||
wl_list_insert(server->views.prev, ¤t_view->link);
|
||||
return true;
|
||||
|
|
@ -45,20 +45,23 @@ static bool handle_keybinding(struct wb_server *server, xkb_keysym_t sym, uint32
|
|||
* client.
|
||||
*/
|
||||
|
||||
struct wb_key_binding *key_binding;
|
||||
if (!server->config)
|
||||
{
|
||||
/* Some default key bindings, when the rc.xml file can't be
|
||||
* parsed. */
|
||||
if (modifiers & WLR_MODIFIER_ALT && sym == XKB_KEY_Tab)
|
||||
cycle_views(server);
|
||||
else if (modifiers & (WLR_MODIFIER_ALT|WLR_MODIFIER_SHIFT) &&
|
||||
sym == XKB_KEY_Tab)
|
||||
cycle_views_reverse(server);
|
||||
else if (sym == XKB_KEY_Escape && modifiers & WLR_MODIFIER_CTRL)
|
||||
wl_display_terminate(server->wl_display);
|
||||
wl_display_terminate(server->wl_display);
|
||||
else
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
struct wb_key_binding *key_binding;
|
||||
wl_list_for_each(key_binding, &server->config->key_bindings, link) {
|
||||
if (sym == key_binding->sym && modifiers == key_binding->modifiers)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -58,10 +58,8 @@ static void xdg_surface_ack_configure(struct wl_listener *listener, void *data)
|
|||
struct wlr_box geo_box;
|
||||
wlr_xdg_surface_get_geometry(view->xdg_toplevel->base, &geo_box);
|
||||
if (geo_box.y < 0)
|
||||
{
|
||||
view->y = geo_box.y * -1;
|
||||
view->configured = true;
|
||||
}
|
||||
view->configured = view->y > 0;
|
||||
|
||||
/* Set size here, so the view->y value will be known */
|
||||
wlr_xdg_toplevel_set_size(view->xdg_toplevel, geo_box.width - view->x, geo_box.height - view->y);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue