mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-21 03:55:04 +00:00
wm: forwarding of clipboard ROM/Report sessions
The labels of clipboard ROM and clipboard report sessions of WM clients must be consistent with the client's nitpicker label. Hence, we must route those sessions through the window manager, analogously to the approach taken for shape reports in #3165. Issue #3437
This commit is contained in:
parent
2da604a6e2
commit
1fe9b07c99
@ -1,8 +1,15 @@
|
||||
<runtime ram="40M" caps="1000" binary="init" config="wm.config">
|
||||
|
||||
<requires> <nitpicker/> <timer/> </requires>
|
||||
<requires>
|
||||
<nitpicker label="focus"/>
|
||||
<nitpicker/>
|
||||
<report label="shape"/>
|
||||
<report label="clipboard"/>
|
||||
<rom label="clipboard"/>
|
||||
<timer/>
|
||||
</requires>
|
||||
|
||||
<provides> <nitpicker/> </provides>
|
||||
<provides> <nitpicker/> <report/> <rom/> </provides>
|
||||
|
||||
<content>
|
||||
<rom label="ld.lib.so"/>
|
||||
|
@ -3,11 +3,13 @@
|
||||
<requires>
|
||||
<nitpicker label="focus"/>
|
||||
<nitpicker/>
|
||||
<report/>
|
||||
<report label="shape"/>
|
||||
<report label="clipboard"/>
|
||||
<rom label="clipboard"/>
|
||||
<timer/>
|
||||
</requires>
|
||||
|
||||
<provides> <nitpicker/> <report/> </provides>
|
||||
<provides> <nitpicker/> <report/> <rom/> </provides>
|
||||
|
||||
<content>
|
||||
<rom label="ld.lib.so"/>
|
||||
|
@ -3,7 +3,9 @@
|
||||
<requires>
|
||||
<nitpicker label="focus"/>
|
||||
<nitpicker/>
|
||||
<report/>
|
||||
<report label="shape"/>
|
||||
<report label="clipboard"/>
|
||||
<rom label="clipboard"/>
|
||||
<timer/>
|
||||
</requires>
|
||||
|
||||
|
@ -19,7 +19,11 @@
|
||||
<default-policy> <child name="wm"/> </default-policy>
|
||||
</service>
|
||||
|
||||
<service name="Report"> <!-- for reporting 'shape' reports through the wm -->
|
||||
<service name="Report"> <!-- for reporting 'shape' and 'clipboard' reports through the wm -->
|
||||
<default-policy> <child name="wm"/> </default-policy>
|
||||
</service>
|
||||
|
||||
<service name="ROM"> <!-- for accessing 'clipboard' ROMs through the wm -->
|
||||
<default-policy> <child name="wm"/> </default-policy>
|
||||
</service>
|
||||
|
||||
@ -45,7 +49,7 @@
|
||||
<start name="wm" caps="250">
|
||||
<resource name="RAM" quantum="6M"/>
|
||||
<provides>
|
||||
<service name="Nitpicker"/> <service name="Report"/>
|
||||
<service name="Nitpicker"/> <service name="Report"/> <service name="ROM"/>
|
||||
</provides>
|
||||
<config>
|
||||
<policy label_prefix="decorator" role="decorator"/>
|
||||
@ -56,6 +60,8 @@
|
||||
<service name="ROM" label="resize_request"> <child name="report_rom"/> </service>
|
||||
<service name="ROM" label="focus"> <child name="report_rom"/> </service>
|
||||
<service name="Report" label_last="shape"> <parent/> </service>
|
||||
<service name="Report" label_last="clipboard"> <parent/> </service>
|
||||
<service name="ROM" label_last="clipboard"> <parent/> </service>
|
||||
<service name="Report"> <child name="report_rom"/> </service>
|
||||
<service name="Nitpicker" label=""> <parent label="focus"/> </service>
|
||||
<any-service>
|
||||
@ -75,9 +81,9 @@
|
||||
<service name="ROM" label="decorator_margins"> <child name="report_rom"/> </service>
|
||||
<service name="ROM" label="rules"> <child name="report_rom"/> </service>
|
||||
<service name="Report"> <child name="report_rom"/> </service>
|
||||
<any-service>
|
||||
<child name="wm"/> <parent/> <any-child/>
|
||||
</any-service>
|
||||
<service name="Nitpicker"> <child name="wm"/> </service>
|
||||
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
@ -92,10 +98,9 @@
|
||||
<service name="ROM" label="pointer"> <child name="report_rom"/> </service>
|
||||
<service name="Report" label="decorator_margins"> <child name="report_rom"/> </service>
|
||||
<service name="Report" label="hover"> <child name="report_rom"/> </service>
|
||||
<service name="Nitpicker"> <child name="wm"/> </service>
|
||||
|
||||
<any-service>
|
||||
<child name="wm"/> <parent/> <any-child/>
|
||||
</any-service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
</config>
|
||||
|
@ -20,36 +20,39 @@
|
||||
</service>
|
||||
|
||||
<service name="ROM">
|
||||
<policy label_suffix="layouter -> window_list">
|
||||
<policy label_suffix=" -> window_list">
|
||||
<child name="report_rom" label="layouter -> window_list"/> </policy>
|
||||
<policy label_suffix="layouter -> focus_request">
|
||||
<policy label_suffix=" -> focus_request">
|
||||
<child name="report_rom" label="layouter -> focus_request"/> </policy>
|
||||
<policy label_suffix="layouter -> hover">
|
||||
<policy label_suffix=" -> hover">
|
||||
<child name="report_rom" label="layouter -> hover"/> </policy>
|
||||
<policy label_suffix="layouter -> decorator_margins">
|
||||
<policy label_suffix=" -> decorator_margins">
|
||||
<child name="report_rom" label="layouter -> decorator_margins"/> </policy>
|
||||
<policy label_suffix="layouter -> rules">
|
||||
<policy label_suffix=" -> rules">
|
||||
<child name="report_rom" label="layouter -> rules"/> </policy>
|
||||
<policy label_suffix="decorator -> window_layout">
|
||||
<policy label_suffix=" -> window_layout">
|
||||
<child name="report_rom" label="decorator -> window_layout"/> </policy>
|
||||
<policy label_suffix="decorator -> pointer">
|
||||
<policy label_suffix=" -> pointer">
|
||||
<child name="report_rom" label="decorator -> pointer"/> </policy>
|
||||
<policy label_suffix=" -> clipboard">
|
||||
<child name="wm"/> </policy>
|
||||
</service>
|
||||
|
||||
<service name="Report">
|
||||
<policy label_suffix="layouter -> window_layout">
|
||||
<policy label_suffix=" -> window_layout">
|
||||
<child name="report_rom" label="layouter -> window_layout"/> </policy>
|
||||
<policy label_suffix="layouter -> resize_request">
|
||||
<policy label_suffix=" -> resize_request">
|
||||
<child name="report_rom" label="layouter -> resize_request"/> </policy>
|
||||
<policy label_suffix="layouter -> focus">
|
||||
<policy label_suffix=" -> focus">
|
||||
<child name="report_rom" label="layouter -> focus"/> </policy>
|
||||
<policy label_suffix="layouter -> rules">
|
||||
<policy label_suffix=" -> rules">
|
||||
<child name="report_rom" label="layouter -> rules"/> </policy>
|
||||
<policy label_suffix="decorator -> hover">
|
||||
<policy label_suffix=" -> hover">
|
||||
<child name="report_rom" label="decorator -> hover"/> </policy>
|
||||
<policy label_suffix="decorator -> decorator_margins">
|
||||
<policy label_suffix=" -> decorator_margins">
|
||||
<child name="report_rom" label="decorator -> decorator_margins"/> </policy>
|
||||
<policy label_suffix="-> shape"> <child name="wm"/> </policy>
|
||||
<policy label_suffix=" -> shape"> <child name="wm"/> </policy>
|
||||
<policy label_suffix=" -> clipboard"> <child name="wm"/> </policy>
|
||||
</service>
|
||||
|
||||
<start name="report_rom">
|
||||
@ -74,7 +77,7 @@
|
||||
<start name="wm" caps="250">
|
||||
<resource name="RAM" quantum="8M"/>
|
||||
<provides>
|
||||
<service name="Nitpicker"/> <service name="Report"/>
|
||||
<service name="Nitpicker"/> <service name="Report"/> <service name="ROM"/>
|
||||
</provides>
|
||||
<config>
|
||||
<policy label_suffix="decorator -> " role="decorator"/>
|
||||
@ -84,8 +87,10 @@
|
||||
<route>
|
||||
<service name="ROM" label="resize_request"> <child name="report_rom"/> </service>
|
||||
<service name="ROM" label="focus"> <child name="report_rom"/> </service>
|
||||
<service name="Report" label_last="shape"> <parent/> </service>
|
||||
<service name="Report"> <child name="report_rom"/> </service>
|
||||
<service name="ROM" label_last="clipboard"> <parent/> </service>
|
||||
<service name="Report" label_last="clipboard"> <parent/> </service>
|
||||
<service name="Report" label_last="shape"> <parent/> </service>
|
||||
<service name="Report"> <child name="report_rom"/> </service>
|
||||
<service name="Nitpicker" label=""> <parent label="focus"/> </service>
|
||||
<any-service> <parent/> </any-service>
|
||||
</route>
|
||||
|
@ -143,7 +143,7 @@ install_config {
|
||||
<start name="wm" caps="200">
|
||||
<resource name="RAM" quantum="6M"/>
|
||||
<provides>
|
||||
<service name="Nitpicker"/> <service name="Report"/>
|
||||
<service name="Nitpicker"/> <service name="Report"/> <service name="ROM"/>
|
||||
</provides>
|
||||
<config>
|
||||
<policy label_prefix="decorator" role="decorator"/>
|
||||
|
@ -107,7 +107,9 @@
|
||||
|
||||
<start name="wm" caps="200">
|
||||
<resource name="RAM" quantum="2M"/>
|
||||
<provides> <service name="Nitpicker"/> <service name="Report"/> </provides>
|
||||
<provides>
|
||||
<service name="Nitpicker"/> <service name="Report"/> <service name="ROM"/>
|
||||
</provides>
|
||||
<config>
|
||||
<policy label_prefix="decorator" role="decorator"/>
|
||||
<default-policy/>
|
||||
|
@ -74,7 +74,9 @@ install_config {
|
||||
<start name="wm" caps="1000">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<binary name="init"/>
|
||||
<provides> <service name="Nitpicker"/> <service name="Report"/> </provides>
|
||||
<provides>
|
||||
<service name="Nitpicker"/> <service name="Report"/> <service name="ROM"/>
|
||||
</provides>
|
||||
<route>
|
||||
<service name="ROM" label="config"> <parent label="wm.config"/> </service>
|
||||
<service name="Nitpicker"> <child name="nitpicker"/> </service>
|
||||
|
@ -23,6 +23,7 @@
|
||||
/* local includes */
|
||||
#include <nitpicker.h>
|
||||
#include <report_forwarder.h>
|
||||
#include <rom_forwarder.h>
|
||||
|
||||
namespace Wm {
|
||||
|
||||
@ -110,6 +111,7 @@ struct Wm::Main
|
||||
{ env.ep(), *this, &Main::handle_resize_request_update };
|
||||
|
||||
Report_forwarder _report_forwarder { env, heap };
|
||||
Rom_forwarder _rom_forwarder { env, heap };
|
||||
|
||||
Main(Genode::Env &env) : env(env)
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* \brief Report service for intercepting shape reports
|
||||
* \brief Report service for intercepting shape and clipboard reports
|
||||
* \author Norman Feske
|
||||
* \date 2019-02-18
|
||||
*
|
||||
@ -7,6 +7,9 @@
|
||||
* policy to an application's shape report as done for the application's
|
||||
* 'Nitpicker' session. This consistency is needed by the pointer to correlate
|
||||
* the currently hovered nitpicker session with the reported shapes.
|
||||
* Analogously, clipboard reports can be routed through the window
|
||||
* manager to support the clipboard component with associating its clients
|
||||
* with nitpicker's reported focus.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
96
repos/gems/src/server/wm/rom_forwarder.h
Normal file
96
repos/gems/src/server/wm/rom_forwarder.h
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* \brief ROM service for intercepting clipboard ROMs
|
||||
* \author Norman Feske
|
||||
* \date 2019-06-26
|
||||
*
|
||||
* This ROM service can be used as proxy for clipboard ROMs to ensure the
|
||||
* consistency of the client labels appearing at the clipboard component
|
||||
* with the label of the currently focused nitpicker client.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2019 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _ROM_FORWARDER_H_
|
||||
#define _ROM_FORWARDER_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <root/component.h>
|
||||
#include <rom_session/connection.h>
|
||||
|
||||
namespace Wm { struct Rom_forwarder; }
|
||||
|
||||
|
||||
struct Wm::Rom_forwarder
|
||||
{
|
||||
struct Session : Genode::Rpc_object<Genode::Rom_session>
|
||||
{
|
||||
Genode::Env &_env;
|
||||
Genode::Rom_connection _connection;
|
||||
|
||||
Session(Genode::Env &env, Genode::Session_label const &label)
|
||||
: _env(env), _connection(env, label.string())
|
||||
{ _env.ep().manage(*this); }
|
||||
|
||||
~Session() { _env.ep().dissolve(*this); }
|
||||
|
||||
void upgrade(Genode::Session::Resources const &resources)
|
||||
{
|
||||
_connection.upgrade(resources);
|
||||
}
|
||||
|
||||
|
||||
/***************************
|
||||
** Rom_session interface **
|
||||
***************************/
|
||||
|
||||
Genode::Rom_dataspace_capability dataspace() override
|
||||
{
|
||||
return _connection.dataspace();
|
||||
}
|
||||
|
||||
bool update() override
|
||||
{
|
||||
return _connection.update();
|
||||
}
|
||||
|
||||
void sigh(Signal_context_capability sigh) override
|
||||
{
|
||||
_connection.sigh(sigh);
|
||||
}
|
||||
};
|
||||
|
||||
struct Root : Genode::Root_component<Session>
|
||||
{
|
||||
Genode::Env &_env;
|
||||
Genode::Allocator &_alloc;
|
||||
|
||||
Session *_create_session(char const *args) override
|
||||
{
|
||||
return new (md_alloc()) Session(_env, Genode::label_from_args(args));
|
||||
}
|
||||
|
||||
void _upgrade_session(Session *session, const char *args) override
|
||||
{
|
||||
session->upgrade(Genode::session_resources_from_args(args));
|
||||
}
|
||||
|
||||
Root(Genode::Env &env, Genode::Allocator &alloc)
|
||||
:
|
||||
Genode::Root_component<Session>(env.ep(), alloc),
|
||||
_env(env), _alloc(alloc)
|
||||
{
|
||||
_env.parent().announce(env.ep().manage(*this));
|
||||
}
|
||||
|
||||
} _root;
|
||||
|
||||
Rom_forwarder(Genode::Env &env, Genode::Allocator &alloc)
|
||||
: _root(env, alloc) { }
|
||||
};
|
||||
|
||||
#endif /* _ROM_FORWARDER_H_ */
|
@ -70,7 +70,9 @@ set config {
|
||||
<start name="wm" caps="1000">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<binary name="init"/>
|
||||
<provides> <service name="Nitpicker"/> </provides>
|
||||
<provides>
|
||||
<service name="Nitpicker"/> <service name="Report"/> <service name="ROM"/>
|
||||
</provides>
|
||||
<route>
|
||||
<service name="ROM" label="config"> <parent label="wm.config"/> </service>
|
||||
<service name="Nitpicker"> <child name="nitpicker"/> </service>
|
||||
|
@ -187,7 +187,7 @@ proc qt5_start_nodes { feature_arg } {
|
||||
<start name="wm" caps="250">
|
||||
<resource name="RAM" quantum="8M"/>
|
||||
<provides>
|
||||
<service name="Nitpicker"/> <service name="Report"/>
|
||||
<service name="Nitpicker"/> <service name="Report"/> <service name="ROM"/>
|
||||
</provides>
|
||||
<config>
|
||||
<policy label_prefix="decorator" role="decorator"/>
|
||||
|
@ -144,7 +144,9 @@ if { $use_vms > 1 } {
|
||||
<start name="wm" caps="1000">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<binary name="init"/>
|
||||
<provides> <service name="Nitpicker"/> <service name="Report"/> </provides>
|
||||
<provides>
|
||||
<service name="Nitpicker"/> <service name="Report"/> <service name="ROM"/>
|
||||
</provides>
|
||||
<route>
|
||||
<service name="ROM" label="config"> <parent label="wm.config"/> </service>
|
||||
<service name="Nitpicker"> <child name="nitpicker"/> </service>
|
||||
|
Loading…
Reference in New Issue
Block a user