mirror of
https://github.com/labwc/labwc.git
synced 2026-02-15 22:05:25 -05:00
include: add config/types.h
This commit is contained in:
parent
6dea8c0dcc
commit
9d49d19cd2
54 changed files with 414 additions and 368 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include <wlr/types/wlr_scene.h>
|
||||
#include "common/direction.h"
|
||||
#include "common/lab-scene-rect.h"
|
||||
#include "config/rcxml.h"
|
||||
#include "labwc.h"
|
||||
#include "output.h"
|
||||
#include "view.h"
|
||||
|
|
@ -96,7 +97,7 @@ inactivate_overlay(struct overlay *overlay)
|
|||
&overlay->edge_rect.tree->node, false);
|
||||
}
|
||||
overlay->active.region = NULL;
|
||||
overlay->active.edge = VIEW_EDGE_INVALID;
|
||||
overlay->active.edge = LAB_EDGE_INVALID;
|
||||
overlay->active.output = NULL;
|
||||
if (overlay->timer) {
|
||||
wl_event_source_timer_update(overlay->timer, 0);
|
||||
|
|
@ -117,9 +118,9 @@ show_region_overlay(struct seat *seat, struct region *region)
|
|||
}
|
||||
|
||||
static struct wlr_box
|
||||
get_edge_snap_box(enum view_edge edge, struct output *output)
|
||||
get_edge_snap_box(enum lab_edge edge, struct output *output)
|
||||
{
|
||||
if (edge == VIEW_EDGE_UP && rc.snap_top_maximize) {
|
||||
if (edge == LAB_EDGE_UP && rc.snap_top_maximize) {
|
||||
return output_usable_area_in_layout_coords(output);
|
||||
} else {
|
||||
return view_get_edge_snap_box(NULL, output, edge);
|
||||
|
|
@ -130,7 +131,7 @@ static int
|
|||
handle_edge_overlay_timeout(void *data)
|
||||
{
|
||||
struct seat *seat = data;
|
||||
assert(seat->overlay.active.edge != VIEW_EDGE_INVALID
|
||||
assert(seat->overlay.active.edge != LAB_EDGE_INVALID
|
||||
&& seat->overlay.active.output);
|
||||
struct wlr_box box = get_edge_snap_box(seat->overlay.active.edge,
|
||||
seat->overlay.active.output);
|
||||
|
|
@ -140,10 +141,10 @@ handle_edge_overlay_timeout(void *data)
|
|||
|
||||
static bool
|
||||
edge_has_adjacent_output_from_cursor(struct seat *seat, struct output *output,
|
||||
enum view_edge edge)
|
||||
enum lab_edge edge)
|
||||
{
|
||||
enum wlr_direction dir;
|
||||
if (!direction_from_view_edge(edge, &dir)) {
|
||||
if (!direction_from_edge(edge, &dir)) {
|
||||
return false;
|
||||
}
|
||||
return wlr_output_layout_adjacent_output(
|
||||
|
|
@ -152,7 +153,7 @@ edge_has_adjacent_output_from_cursor(struct seat *seat, struct output *output,
|
|||
}
|
||||
|
||||
static void
|
||||
show_edge_overlay(struct seat *seat, enum view_edge edge1, enum view_edge edge2,
|
||||
show_edge_overlay(struct seat *seat, enum lab_edge edge1, enum lab_edge edge2,
|
||||
struct output *output)
|
||||
{
|
||||
if (!rc.snap_overlay_enabled) {
|
||||
|
|
@ -205,7 +206,7 @@ overlay_update(struct seat *seat)
|
|||
|
||||
/* Edge-snapping overlay */
|
||||
struct output *output;
|
||||
enum view_edge edge1, edge2;
|
||||
enum lab_edge edge1, edge2;
|
||||
if (edge_from_cursor(seat, &output, &edge1, &edge2)) {
|
||||
show_edge_overlay(seat, edge1, edge2, output);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue