GithubHelp home page GithubHelp logo

Comments (3)

Consolatis avatar Consolatis commented on September 21, 2024 1

The window rules are set up to have different events even though only ON_FIRST_MAP is implemented so far (and is the default if the event argument is missing from the window rule). I guess we could just add another event like ON_CREATE or something like that. However, I am also not sure about the implications of having the event run before map.

E.g. something like this:

<windowRule identifier="foot" event="onCreate">
    <action name="SnapToEdge" direction="up" />
</windowRule>

from labwc.

tokyo4j avatar tokyo4j commented on September 21, 2024

This can be solved by applying window rules before the client maps a surface. I confirmed the following patch solves the flickering issue for xdg-shell clients, but I'm not sure if it's okay to apply normal actions against views that have not been mapped.

diff --git a/src/xdg.c b/src/xdg.c
index 4e6d6dad..ce06259a 100644
--- a/src/xdg.c
+++ b/src/xdg.c
@@ -795,6 +795,8 @@ xdg_surface_new(struct wl_listener *listener, void *data)
 	CONNECT_SIGNAL(xdg_surface, xdg_toplevel_view, new_popup);
 
 	wl_list_insert(&server->views, &view->link);
+
+	window_rules_apply(view, LAB_WINDOW_RULE_EVENT_ON_FIRST_MAP);
 }
 
 void

Another approach would be disabling the view node until the client applies the geometry requested by window rules, but the problem is wlroots automatically sends wl_surface.leave and doesn't return frame callback if the node is disabled, thus the configure event timeouts.

from labwc.

tokyo4j avatar tokyo4j commented on September 21, 2024

I think onCreate is usefu also when the user want to open a fullscreen window in a fixed output (#1859).

from labwc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.