mirror of
https://github.com/labwc/labwc.git
synced 2026-04-08 08:21:09 -04:00
tree-wide: rename g_server to just server
This commit is contained in:
parent
8d46da9db1
commit
4f72e6775e
61 changed files with 955 additions and 955 deletions
|
|
@ -62,7 +62,7 @@ wants_indicator(struct view *view)
|
|||
assert(view);
|
||||
|
||||
if (rc.resize_indicator == LAB_RESIZE_INDICATOR_NON_PIXEL) {
|
||||
if (g_server.input_mode != LAB_INPUT_STATE_RESIZE) {
|
||||
if (server.input_mode != LAB_INPUT_STATE_RESIZE) {
|
||||
return false;
|
||||
}
|
||||
struct view_size_hints hints = view_get_size_hints(view);
|
||||
|
|
@ -77,12 +77,12 @@ void
|
|||
resize_indicator_reconfigure(void)
|
||||
{
|
||||
struct view *view;
|
||||
wl_list_for_each(view, &g_server.views, link) {
|
||||
wl_list_for_each(view, &server.views, link) {
|
||||
struct resize_indicator *indicator = &view->resize_indicator;
|
||||
if (indicator->tree) {
|
||||
resize_indicator_reconfigure_view(indicator);
|
||||
}
|
||||
if (view != g_server.grabbed_view) {
|
||||
if (view != server.grabbed_view) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ void
|
|||
resize_indicator_update(struct view *view)
|
||||
{
|
||||
assert(view);
|
||||
assert(view == g_server.grabbed_view);
|
||||
assert(view == server.grabbed_view);
|
||||
|
||||
if (!wants_indicator(view)) {
|
||||
return;
|
||||
|
|
@ -173,21 +173,21 @@ resize_indicator_update(struct view *view)
|
|||
view_box.height = view_effective_height(view, /* use_pending */ false);
|
||||
}
|
||||
|
||||
if (g_server.input_mode == LAB_INPUT_STATE_RESIZE) {
|
||||
if (server.input_mode == LAB_INPUT_STATE_RESIZE) {
|
||||
struct view_size_hints hints = view_get_size_hints(view);
|
||||
snprintf(text, sizeof(text), "%d x %d",
|
||||
MAX(0, view_box.width - hints.base_width)
|
||||
/ MAX(1, hints.width_inc),
|
||||
MAX(0, view_box.height - hints.base_height)
|
||||
/ MAX(1, hints.height_inc));
|
||||
} else if (g_server.input_mode == LAB_INPUT_STATE_MOVE) {
|
||||
} else if (server.input_mode == LAB_INPUT_STATE_MOVE) {
|
||||
struct border margin = ssd_get_margin(view->ssd);
|
||||
snprintf(text, sizeof(text), "%d , %d",
|
||||
view_box.x - margin.left,
|
||||
view_box.y - margin.top);
|
||||
} else {
|
||||
wlr_log(WLR_ERROR, "Invalid input mode for indicator update %u",
|
||||
g_server.input_mode);
|
||||
server.input_mode);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ ssd_border_create(struct ssd *ssd)
|
|||
assert(!ssd->border.tree);
|
||||
|
||||
struct view *view = ssd->view;
|
||||
struct theme *theme = g_server.theme;
|
||||
struct theme *theme = server.theme;
|
||||
int width = view->current.width;
|
||||
int height = view_effective_height(view, /* use_pending */ false);
|
||||
int full_width = width + 2 * theme->border_width;
|
||||
|
|
@ -90,7 +90,7 @@ ssd_border_update(struct ssd *ssd)
|
|||
ssd->margin = ssd_thickness(ssd->view);
|
||||
}
|
||||
|
||||
struct theme *theme = g_server.theme;
|
||||
struct theme *theme = server.theme;
|
||||
|
||||
int width = view->current.width;
|
||||
int height = view_effective_height(view, /* use_pending */ false);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ void
|
|||
ssd_extents_create(struct ssd *ssd)
|
||||
{
|
||||
struct view *view = ssd->view;
|
||||
struct theme *theme = g_server.theme;
|
||||
struct theme *theme = server.theme;
|
||||
|
||||
int border_width = MAX(0, MAX(rc.resize_minimum_area, theme->border_width));
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ ssd_extents_update(struct ssd *ssd)
|
|||
return;
|
||||
}
|
||||
|
||||
struct theme *theme = g_server.theme;
|
||||
struct theme *theme = server.theme;
|
||||
|
||||
int width = view->current.width;
|
||||
int height = view_effective_height(view, /* use_pending */ false);
|
||||
|
|
@ -120,7 +120,7 @@ ssd_extents_update(struct ssd *ssd)
|
|||
pixman_region32_t usable;
|
||||
pixman_region32_init(&usable);
|
||||
struct output *output;
|
||||
wl_list_for_each(output, &g_server.outputs, link) {
|
||||
wl_list_for_each(output, &server.outputs, link) {
|
||||
if (!view_on_output(view, output)) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ static void
|
|||
set_shadow_geometry(struct ssd *ssd)
|
||||
{
|
||||
struct view *view = ssd->view;
|
||||
struct theme *theme = g_server.theme;
|
||||
struct theme *theme = server.theme;
|
||||
int titlebar_height = ssd->titlebar.height;
|
||||
int width = view->current.width;
|
||||
int height = view_effective_height(view, false) + titlebar_height;
|
||||
|
|
@ -203,7 +203,7 @@ ssd_shadow_create(struct ssd *ssd)
|
|||
|
||||
ssd->shadow.tree = lab_wlr_scene_tree_create(ssd->tree);
|
||||
|
||||
struct theme *theme = g_server.theme;
|
||||
struct theme *theme = server.theme;
|
||||
struct view *view = ssd->view;
|
||||
|
||||
enum ssd_active_state active;
|
||||
|
|
@ -256,7 +256,7 @@ ssd_shadow_update(struct ssd *ssd)
|
|||
assert(ssd->shadow.tree);
|
||||
|
||||
struct view *view = ssd->view;
|
||||
struct theme *theme = g_server.theme;
|
||||
struct theme *theme = server.theme;
|
||||
bool maximized = view->maximized == VIEW_AXIS_BOTH;
|
||||
bool tiled_shadows = false;
|
||||
if (rc.shadows_on_tiled) {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ void
|
|||
ssd_titlebar_create(struct ssd *ssd)
|
||||
{
|
||||
struct view *view = ssd->view;
|
||||
struct theme *theme = g_server.theme;
|
||||
struct theme *theme = server.theme;
|
||||
int width = view->current.width;
|
||||
int corner_width = ssd_get_corner_width();
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ ssd_titlebar_create(struct ssd *ssd)
|
|||
* TODO: remove once https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3990
|
||||
* is solved
|
||||
*/
|
||||
if (wlr_renderer_is_pixman(g_server.renderer)) {
|
||||
if (wlr_renderer_is_pixman(server.renderer)) {
|
||||
wlr_scene_buffer_set_filter_mode(
|
||||
subtree->bar, WLR_SCALE_FILTER_NEAREST);
|
||||
}
|
||||
|
|
@ -160,7 +160,7 @@ set_squared_corners(struct ssd *ssd, bool enable)
|
|||
struct view *view = ssd->view;
|
||||
int width = view->current.width;
|
||||
int corner_width = ssd_get_corner_width();
|
||||
struct theme *theme = g_server.theme;
|
||||
struct theme *theme = server.theme;
|
||||
|
||||
int x = enable ? 0 : corner_width;
|
||||
|
||||
|
|
@ -220,7 +220,7 @@ static void
|
|||
update_visible_buttons(struct ssd *ssd)
|
||||
{
|
||||
struct view *view = ssd->view;
|
||||
struct theme *theme = g_server.theme;
|
||||
struct theme *theme = server.theme;
|
||||
int width = MAX(view->current.width - 2 * theme->window_titlebar_padding_width, 0);
|
||||
int button_width = theme->window_button_width;
|
||||
int button_spacing = theme->window_button_spacing;
|
||||
|
|
@ -273,7 +273,7 @@ ssd_titlebar_update(struct ssd *ssd)
|
|||
struct view *view = ssd->view;
|
||||
int width = view->current.width;
|
||||
int corner_width = ssd_get_corner_width();
|
||||
struct theme *theme = g_server.theme;
|
||||
struct theme *theme = server.theme;
|
||||
|
||||
bool maximized = view->maximized == VIEW_AXIS_BOTH;
|
||||
bool squared = ssd_should_be_squared(ssd);
|
||||
|
|
@ -365,7 +365,7 @@ static void
|
|||
ssd_update_title_positions(struct ssd *ssd, int offset_left, int offset_right)
|
||||
{
|
||||
struct view *view = ssd->view;
|
||||
struct theme *theme = g_server.theme;
|
||||
struct theme *theme = server.theme;
|
||||
int width = view->current.width;
|
||||
int title_bg_width = width - offset_left - offset_right;
|
||||
|
||||
|
|
@ -413,9 +413,9 @@ static void
|
|||
get_title_offsets(struct ssd *ssd, int *offset_left, int *offset_right)
|
||||
{
|
||||
struct ssd_titlebar_subtree *subtree = &ssd->titlebar.subtrees[SSD_ACTIVE];
|
||||
int button_width = g_server.theme->window_button_width;
|
||||
int button_spacing = g_server.theme->window_button_spacing;
|
||||
int padding_width = g_server.theme->window_titlebar_padding_width;
|
||||
int button_width = server.theme->window_button_width;
|
||||
int button_spacing = server.theme->window_button_spacing;
|
||||
int padding_width = server.theme->window_titlebar_padding_width;
|
||||
*offset_left = padding_width;
|
||||
*offset_right = padding_width;
|
||||
|
||||
|
|
@ -443,7 +443,7 @@ ssd_update_title(struct ssd *ssd)
|
|||
/* view->title is never NULL (instead it can be an empty string) */
|
||||
assert(view->title);
|
||||
|
||||
struct theme *theme = g_server.theme;
|
||||
struct theme *theme = server.theme;
|
||||
struct ssd_state_title *state = &ssd->state.title;
|
||||
bool title_unchanged = state->text && !strcmp(view->title, state->text);
|
||||
|
||||
|
|
@ -493,17 +493,17 @@ ssd_update_hovered_button(struct wlr_scene_node *node)
|
|||
|
||||
if (node && node->data) {
|
||||
button = node_try_ssd_button_from_node(node);
|
||||
if (button == g_server.hovered_button) {
|
||||
if (button == server.hovered_button) {
|
||||
/* Cursor is still on the same button */
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Disable old hover */
|
||||
if (g_server.hovered_button) {
|
||||
update_button_state(g_server.hovered_button, LAB_BS_HOVERED, false);
|
||||
if (server.hovered_button) {
|
||||
update_button_state(server.hovered_button, LAB_BS_HOVERED, false);
|
||||
}
|
||||
g_server.hovered_button = button;
|
||||
server.hovered_button = button;
|
||||
if (button) {
|
||||
update_button_state(button, LAB_BS_HOVERED, true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ ssd_thickness(struct view *view)
|
|||
return (struct border){ 0 };
|
||||
}
|
||||
|
||||
struct theme *theme = g_server.theme;
|
||||
struct theme *theme = server.theme;
|
||||
|
||||
if (view->maximized == VIEW_AXIS_BOTH) {
|
||||
struct border thickness = { 0 };
|
||||
|
|
@ -101,7 +101,7 @@ ssd_get_resizing_type(const struct ssd *ssd, struct wlr_cursor *cursor)
|
|||
|
||||
if (view_titlebar_visible(view)) {
|
||||
/* If the titlebar is visible, consider it part of the view */
|
||||
int titlebar_height = g_server.theme->titlebar_height;
|
||||
int titlebar_height = server.theme->titlebar_height;
|
||||
view_box.y -= titlebar_height;
|
||||
view_box.height += titlebar_height;
|
||||
}
|
||||
|
|
@ -156,7 +156,7 @@ ssd_create(struct view *view, bool active)
|
|||
LAB_NODE_SSD_ROOT, view, /*data*/ NULL);
|
||||
|
||||
wlr_scene_node_lower_to_bottom(&ssd->tree->node);
|
||||
ssd->titlebar.height = g_server.theme->titlebar_height;
|
||||
ssd->titlebar.height = server.theme->titlebar_height;
|
||||
ssd_shadow_create(ssd);
|
||||
ssd_extents_create(ssd);
|
||||
/*
|
||||
|
|
@ -257,7 +257,7 @@ ssd_set_titlebar(struct ssd *ssd, bool enabled)
|
|||
return;
|
||||
}
|
||||
wlr_scene_node_set_enabled(&ssd->titlebar.tree->node, enabled);
|
||||
ssd->titlebar.height = enabled ? g_server.theme->titlebar_height : 0;
|
||||
ssd->titlebar.height = enabled ? server.theme->titlebar_height : 0;
|
||||
ssd_border_update(ssd);
|
||||
ssd_extents_update(ssd);
|
||||
ssd_shadow_update(ssd);
|
||||
|
|
@ -273,9 +273,9 @@ ssd_destroy(struct ssd *ssd)
|
|||
|
||||
/* Maybe reset hover view */
|
||||
struct view *view = ssd->view;
|
||||
if (g_server.hovered_button && node_view_from_node(
|
||||
g_server.hovered_button->node) == view) {
|
||||
g_server.hovered_button = NULL;
|
||||
if (server.hovered_button && node_view_from_node(
|
||||
server.hovered_button->node) == view) {
|
||||
server.hovered_button = NULL;
|
||||
}
|
||||
|
||||
/* Destroy subcomponents */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue