mirror of
https://github.com/labwc/labwc.git
synced 2026-03-18 05:33:53 -04:00
window-rules: add skipTaskbar and skipWindowSwitcher
This commit is contained in:
parent
15cd093f2e
commit
a6f0fc9c62
7 changed files with 51 additions and 7 deletions
|
|
@ -430,6 +430,15 @@ situation.
|
||||||
*serverDecoration* over-rules any other setting for server-side window
|
*serverDecoration* over-rules any other setting for server-side window
|
||||||
decoration on first map.
|
decoration on first map.
|
||||||
|
|
||||||
|
*<windowRules><windowRule skipTaskbar="">* [yes|no|default]
|
||||||
|
*skipTaskbar* removes window foreign-toplevel protocol handle so that
|
||||||
|
it does not appear in clients such as panels and taskbars using that
|
||||||
|
protocol.
|
||||||
|
|
||||||
|
*<windowRules><windowRule skipWindowSwitcher="">* [yes|no|default]
|
||||||
|
*skipWindowSwitcher* removes window from the Window Switcher (alt-tab
|
||||||
|
on-screen-display)
|
||||||
|
|
||||||
## ENVIRONMENT VARIABLES
|
## ENVIRONMENT VARIABLES
|
||||||
|
|
||||||
*XCURSOR_THEME* and *XCURSOR_SIZE* are supported to set cursor theme
|
*XCURSOR_THEME* and *XCURSOR_SIZE* are supported to set cursor theme
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ struct window_rule {
|
||||||
struct wl_list actions;
|
struct wl_list actions;
|
||||||
|
|
||||||
enum property server_decoration;
|
enum property server_decoration;
|
||||||
|
enum property skip_taskbar;
|
||||||
|
enum property skip_window_switcher;
|
||||||
|
|
||||||
struct wl_list link; /* struct rcxml.window_rules */
|
struct wl_list link; /* struct rcxml.window_rules */
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,10 @@ fill_window_rule(char *nodename, char *content)
|
||||||
/* Properties */
|
/* Properties */
|
||||||
} else if (!strcasecmp(nodename, "serverDecoration")) {
|
} else if (!strcasecmp(nodename, "serverDecoration")) {
|
||||||
set_property(content, ¤t_window_rule->server_decoration);
|
set_property(content, ¤t_window_rule->server_decoration);
|
||||||
|
} else if (!strcasecmp(nodename, "skipTaskbar")) {
|
||||||
|
set_property(content, ¤t_window_rule->skip_taskbar);
|
||||||
|
} else if (!strcasecmp(nodename, "skipWindowSwitcher")) {
|
||||||
|
set_property(content, ¤t_window_rule->skip_window_switcher);
|
||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
} else if (!strcmp(nodename, "name.action")) {
|
} else if (!strcmp(nodename, "name.action")) {
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
#include "node.h"
|
#include "node.h"
|
||||||
#include "ssd.h"
|
#include "ssd.h"
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
|
#include "window-rules.h"
|
||||||
#include "workspaces.h"
|
#include "workspaces.h"
|
||||||
#include "xwayland.h"
|
#include "xwayland.h"
|
||||||
|
|
||||||
|
|
@ -191,7 +192,9 @@ desktop_cycle_view(struct server *server, struct view *start_view,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
view = node_view_from_node(node);
|
view = node_view_from_node(node);
|
||||||
if (isfocusable(view)) {
|
|
||||||
|
enum property skip = window_rules_get_property(view, "skipWindowSwitcher");
|
||||||
|
if (isfocusable(view) && skip != LAB_PROP_TRUE) {
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
} while (view != start_view);
|
} while (view != start_view);
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
#include "theme.h"
|
#include "theme.h"
|
||||||
#include "node.h"
|
#include "node.h"
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
|
#include "window-rules.h"
|
||||||
#include "workspaces.h"
|
#include "workspaces.h"
|
||||||
|
|
||||||
#define OSD_ITEM_HEIGHT (20)
|
#define OSD_ITEM_HEIGHT (20)
|
||||||
|
|
@ -69,7 +70,8 @@ get_osd_height(struct wl_list *node_list)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
view = node_view_from_node(node);
|
view = node_view_from_node(node);
|
||||||
if (!isfocusable(view)) {
|
enum property skip = window_rules_get_property(view, "skipWindowSwitcher");
|
||||||
|
if (!isfocusable(view) || skip == LAB_PROP_TRUE) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
height += OSD_ITEM_HEIGHT;
|
height += OSD_ITEM_HEIGHT;
|
||||||
|
|
@ -344,7 +346,8 @@ render_osd(struct server *server, cairo_t *cairo, int w, int h,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
struct view *view = node_view_from_node(node);
|
struct view *view = node_view_from_node(node);
|
||||||
if (!isfocusable(view)) {
|
enum property skip = window_rules_get_property(view, "skipWindowSwitcher");
|
||||||
|
if (!isfocusable(view) || skip == LAB_PROP_TRUE) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,22 @@ view_impl_map(struct view *view)
|
||||||
if (!view->been_mapped) {
|
if (!view->been_mapped) {
|
||||||
window_rules_apply(view, LAB_WINDOW_RULE_EVENT_ON_FIRST_MAP);
|
window_rules_apply(view, LAB_WINDOW_RULE_EVENT_ON_FIRST_MAP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* It's tempting to just never create the foreign-toplevel handle in the
|
||||||
|
* map handlers, but the app_id/title might not have been set at that
|
||||||
|
* point, so it's safer to process the property here
|
||||||
|
*/
|
||||||
|
enum property ret = window_rules_get_property(view, "skipTaskbar");
|
||||||
|
if (ret == LAB_PROP_TRUE) {
|
||||||
|
if (view->toplevel.handle) {
|
||||||
|
wlr_foreign_toplevel_handle_v1_destroy(view->toplevel.handle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
wlr_log(WLR_DEBUG, "[map] identifier=%s, title=%s\n",
|
||||||
|
view_get_string_prop(view, "app_id"),
|
||||||
|
view_get_string_prop(view, "title"));
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
|
|
||||||
|
|
@ -81,10 +81,17 @@ window_rules_get_property(struct view *view, const char *property)
|
||||||
* for.
|
* for.
|
||||||
*/
|
*/
|
||||||
if (view_matches_criteria(rule, view)) {
|
if (view_matches_criteria(rule, view)) {
|
||||||
if (!strcasecmp(property, "serverDecoration")) {
|
if (rule->server_decoration
|
||||||
if (rule->server_decoration) {
|
&& !strcasecmp(property, "serverDecoration")) {
|
||||||
return rule->server_decoration;
|
return rule->server_decoration;
|
||||||
}
|
}
|
||||||
|
if (rule->skip_taskbar
|
||||||
|
&& !strcasecmp(property, "skipTaskbar")) {
|
||||||
|
return rule->skip_taskbar;
|
||||||
|
}
|
||||||
|
if (rule->skip_window_switcher
|
||||||
|
&& !strcasecmp(property, "skipWindowSwitcher")) {
|
||||||
|
return rule->skip_window_switcher;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue