mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 08:25:38 +00:00
parent
5e4b523357
commit
c6718677b2
@ -160,9 +160,10 @@ void Vbox_pointer::Main::_show_shape_pointer(Policy *p)
|
||||
throw;
|
||||
}
|
||||
|
||||
if (p->shape_visible()) {
|
||||
Genode::Attached_dataspace ds { _env.rm(), _pointer_ds };
|
||||
|
||||
p->draw_shape(ds.local_addr<Genode::Pixel_rgb565>());
|
||||
}
|
||||
|
||||
_nitpicker.framebuffer()->refresh(0, 0, p->shape_size().w(), p->shape_size().h());
|
||||
|
||||
@ -180,7 +181,7 @@ void Vbox_pointer::Main::_update_pointer()
|
||||
|
||||
if (_xray
|
||||
|| !(policy = _policy_registry.lookup(_hovered_label, _hovered_domain))
|
||||
|| !policy->shape_valid())
|
||||
|| (policy->shape_visible() && !policy->shape_valid()))
|
||||
_show_default_pointer();
|
||||
else
|
||||
try {
|
||||
|
@ -54,6 +54,7 @@ class Vbox_pointer::Policy_entry : public Vbox_pointer::Policy,
|
||||
Genode::Signal_handler<Policy_entry> _shape_signal_handler {
|
||||
_env.ep(), *this, &Policy_entry::_import_shape };
|
||||
|
||||
bool _shape_visible;
|
||||
Nitpicker::Area _shape_size;
|
||||
Nitpicker::Point _shape_hot;
|
||||
|
||||
@ -72,13 +73,16 @@ class Vbox_pointer::Policy_entry : public Vbox_pointer::Policy,
|
||||
Vbox_pointer::Shape_report *shape_report =
|
||||
_shape_ds.local_addr<Vbox_pointer::Shape_report>();
|
||||
|
||||
if (!shape_report->visible
|
||||
_shape_visible = shape_report->visible;
|
||||
|
||||
if (!_shape_visible
|
||||
|| shape_report->width == 0 || shape_report->height == 0
|
||||
|| shape_report->width > Vbox_pointer::MAX_WIDTH
|
||||
|| shape_report->height > Vbox_pointer::MAX_HEIGHT) {
|
||||
_shape_size = Nitpicker::Area();
|
||||
_shape_hot = Nitpicker::Point();
|
||||
_updater.update_pointer(*this);
|
||||
return;
|
||||
}
|
||||
|
||||
_shape_size = Nitpicker::Area(shape_report->width, shape_report->height);
|
||||
@ -154,6 +158,7 @@ class Vbox_pointer::Policy_entry : public Vbox_pointer::Policy,
|
||||
Nitpicker::Area shape_size() const override { return _shape_size; }
|
||||
Nitpicker::Point shape_hot() const override { return _shape_hot; }
|
||||
|
||||
bool shape_visible() const override { return _shape_visible; }
|
||||
bool shape_valid() const override { return _shape_size.valid(); }
|
||||
|
||||
void draw_shape(Genode::Pixel_rgb565 *pixel) override
|
||||
|
@ -42,6 +42,7 @@ struct Vbox_pointer::Policy
|
||||
{
|
||||
virtual Nitpicker::Area shape_size() const = 0;
|
||||
virtual Nitpicker::Point shape_hot() const = 0;
|
||||
virtual bool shape_visible() const = 0;
|
||||
virtual bool shape_valid() const = 0;
|
||||
|
||||
virtual void draw_shape(Genode::Pixel_rgb565 *pixel) = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user