diff options
-rw-r--r-- | common/pango.c | 5 | ||||
-rw-r--r-- | contrib/awesome.config | 63 | ||||
-rw-r--r-- | sway/tree/workspace.c | 10 |
3 files changed, 5 insertions, 73 deletions
diff --git a/common/pango.c b/common/pango.c index 5afd72d8..ba74692e 100644 --- a/common/pango.c +++ b/common/pango.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <stdio.h> | 6 | #include <stdio.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #include <string.h> | 8 | #include <string.h> |
9 | #include "cairo.h" | ||
9 | #include "log.h" | 10 | #include "log.h" |
10 | #include "stringop.h" | 11 | #include "stringop.h" |
11 | 12 | ||
@@ -113,6 +114,10 @@ void pango_printf(cairo_t *cairo, const char *font, | |||
113 | va_end(args); | 114 | va_end(args); |
114 | 115 | ||
115 | PangoLayout *layout = get_pango_layout(cairo, font, buf, scale, markup); | 116 | PangoLayout *layout = get_pango_layout(cairo, font, buf, scale, markup); |
117 | cairo_font_options_t *fo = cairo_font_options_create(); | ||
118 | cairo_get_font_options(cairo, fo); | ||
119 | pango_cairo_context_set_font_options(pango_layout_get_context(layout), fo); | ||
120 | cairo_font_options_destroy(fo); | ||
116 | pango_cairo_update_layout(cairo, layout); | 121 | pango_cairo_update_layout(cairo, layout); |
117 | pango_cairo_show_layout(cairo, layout); | 122 | pango_cairo_show_layout(cairo, layout); |
118 | g_object_unref(layout); | 123 | g_object_unref(layout); |
diff --git a/contrib/awesome.config b/contrib/awesome.config deleted file mode 100644 index 41e17c91..00000000 --- a/contrib/awesome.config +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | # | ||
2 | # Replicate some of Awesome's default layout manipulation configuration for Sway | ||
3 | # | ||
4 | # Differences: | ||
5 | # - Layout switching doesn't use the spacebar (i.e. i3/Sway behavior to switch to/from floating windows) | ||
6 | # and uses the 'A' key instead (as in auto) | ||
7 | # - Resizing windows uses i3/Sway's more versatile Mod4+r | ||
8 | # - no tags | ||
9 | # - no Maximize/Minize, alternatives to Maximize would be to switch to Stacked/Tabbed layouts | ||
10 | # via Mod4+w or Mod4+s. | ||
11 | # - kill focused client is available on Mod4+Shift+q (instead of Mod4+Shift+c, which maps to Sway's | ||
12 | # config reload) | ||
13 | # - probably many more ... | ||
14 | |||
15 | # Awesome-style container traversal using Vim-like binding | ||
16 | set $next j | ||
17 | set $prev k | ||
18 | |||
19 | # | ||
20 | # Moving around: | ||
21 | # | ||
22 | # Move your focus around | ||
23 | bindsym $mod+$next focus next | ||
24 | bindsym $mod+$prev focus prev | ||
25 | |||
26 | # _move_ the focused window with the same, but add Shift | ||
27 | bindsym $mod+Shift+$next move next | ||
28 | bindsym $mod+Shift+$prev move prev | ||
29 | |||
30 | # | ||
31 | # Layout: | ||
32 | # | ||
33 | workspace_layout auto left | ||
34 | |||
35 | # This is usually bound to $mod+space, but this works well in practice by keeping | ||
36 | # all the layout switching keys grouped together. | ||
37 | bindsym $mod+a layout auto next | ||
38 | bindsym $mod+Shift+a layout auto prev | ||
39 | |||
40 | # Promote a child to master position in an auto layout | ||
41 | bindsym $mod+Control+Return move first | ||
42 | |||
43 | # Increase/decrease number of master elements in auto layout | ||
44 | bindsym $mod+Shift+h layout auto master inc 1 | ||
45 | bindsym $mod+Shift+l layout auto master inc -1 | ||
46 | |||
47 | # Increase/decrease number of slave element groups in auto layout | ||
48 | bindsym $mod+Control+h layout auto ncol inc 1 | ||
49 | bindsym $mod+Control+l layout auto ncol inc -1 | ||
50 | |||
51 | # | ||
52 | # Resizing containers: | ||
53 | # Again, not really the way Awesome works well, but in spirit with i3/Sway and it works well. | ||
54 | # | ||
55 | mode "resize" { | ||
56 | bindsym Left resize shrink width 20 px | ||
57 | bindsym Down resize grow height 20 px | ||
58 | bindsym Up resize shrink height 20 px | ||
59 | bindsym Right resize grow width 20 px | ||
60 | } | ||
61 | bindsym $mod+r mode "resize" | ||
62 | |||
63 | new_window pixel 1 | ||
diff --git a/sway/tree/workspace.c b/sway/tree/workspace.c index 18746430..b0c440c1 100644 --- a/sway/tree/workspace.c +++ b/sway/tree/workspace.c | |||
@@ -389,13 +389,11 @@ bool workspace_switch(struct sway_workspace *workspace, | |||
389 | struct sway_output *next_output = workspace->output; | 389 | struct sway_output *next_output = workspace->output; |
390 | struct sway_workspace *next_output_prev_ws = | 390 | struct sway_workspace *next_output_prev_ws = |
391 | output_get_active_workspace(next_output); | 391 | output_get_active_workspace(next_output); |
392 | bool has_sticky = false; | ||
393 | if (workspace != next_output_prev_ws) { | 392 | if (workspace != next_output_prev_ws) { |
394 | for (int i = 0; i < next_output_prev_ws->floating->length; ++i) { | 393 | for (int i = 0; i < next_output_prev_ws->floating->length; ++i) { |
395 | struct sway_container *floater = | 394 | struct sway_container *floater = |
396 | next_output_prev_ws->floating->items[i]; | 395 | next_output_prev_ws->floating->items[i]; |
397 | if (floater->is_sticky) { | 396 | if (floater->is_sticky) { |
398 | has_sticky = true; | ||
399 | container_detach(floater); | 397 | container_detach(floater); |
400 | workspace_add_floating(workspace, floater); | 398 | workspace_add_floating(workspace, floater); |
401 | if (&floater->node == focus) { | 399 | if (&floater->node == focus) { |
@@ -414,14 +412,6 @@ bool workspace_switch(struct sway_workspace *workspace, | |||
414 | if (next == NULL) { | 412 | if (next == NULL) { |
415 | next = &workspace->node; | 413 | next = &workspace->node; |
416 | } | 414 | } |
417 | if (has_sticky) { | ||
418 | // If there's a sticky container, we might be setting focus to the same | ||
419 | // container that's already focused, so seat_set_focus is effectively a | ||
420 | // no op. We therefore need to send the IPC event and clean up the old | ||
421 | // workspace here. | ||
422 | ipc_event_workspace(active_ws, workspace, "focus"); | ||
423 | workspace_consider_destroy(active_ws); | ||
424 | } | ||
425 | seat_set_focus(seat, next); | 415 | seat_set_focus(seat, next); |
426 | arrange_workspace(workspace); | 416 | arrange_workspace(workspace); |
427 | cursor_send_pointer_motion(seat->cursor, 0, true); | 417 | cursor_send_pointer_motion(seat->cursor, 0, true); |