Skip to content

Commit

Permalink
Merge pull request #683 from o-sdn-o/gui-bridge
Browse files Browse the repository at this point in the history
Fix window focusing by mouse click
  • Loading branch information
o-sdn-o authored Nov 19, 2024
2 parents 5fa979d + 6e3228a commit 7c39f2c
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 161 deletions.
4 changes: 2 additions & 2 deletions src/netxs/apps/tile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ namespace netxs::events::userland
{
EVENT_XS( create , input::hids ),
EVENT_XS( close , input::hids ),
EVENT_XS( toggle , input::hids ), // toggle window size: maximize/restore.
EVENT_XS( toggle , input::hids ), // Toggle window size: maximize/restore.
EVENT_XS( swap , input::hids ),
EVENT_XS( rotate , input::hids ), // change nested objects order. See tilimg manager (ui::fork).
EVENT_XS( rotate , input::hids ), // Change nested objects order. See tilimg manager (ui::fork).
EVENT_XS( equalize, input::hids ),
EVENT_XS( select , input::hids ),
GROUP_XS( split , input::hids ),
Expand Down
2 changes: 1 addition & 1 deletion src/netxs/desktopio/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace netxs::app

namespace netxs::app::shared
{
static const auto version = "v0.9.99.46";
static const auto version = "v0.9.99.47";
static const auto repository = "https://github.com/directvt/vtm";
static const auto usr_config = "~/.config/vtm/settings.xml"s;
static const auto sys_config = "/etc/vtm/settings.xml"s;
Expand Down
247 changes: 109 additions & 138 deletions src/netxs/desktopio/baseui.hpp

Large diffs are not rendered by default.

10 changes: 4 additions & 6 deletions src/netxs/desktopio/controls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1230,10 +1230,9 @@ namespace netxs::ui
auto iter = gears.find(gear.id);
if (iter != gears.end())
{
//todo replace/drop prev default focus
auto& route = iter->second;
auto token = std::move(route.token);
if (route.active) // Make the active branch the default.
if (route.active) // Make the active branch default.
{
route.active = faux;
gears[id_t{}] = std::move(route);
Expand Down Expand Up @@ -1438,8 +1437,7 @@ namespace netxs::ui
boss.LISTEN(tier::preview, hids::events::keybd::key::post, gear, memo) // preview: Run after any.
{
if (!gear) return;
if (gear.payload == input::keybd::type::keypress
&& std::exchange(hotkey_scheme, gear.meta(hids::HotkeyScheme)) != hotkey_scheme) // Notify if hotkey scheme has changed.
if (gear.payload == input::keybd::type::keypress && std::exchange(hotkey_scheme, gear.meta(hids::HotkeyScheme)) != hotkey_scheme) // Notify if hotkey scheme has changed.
{
hotkey_scheme_notify();
}
Expand Down Expand Up @@ -1523,10 +1521,10 @@ namespace netxs::ui
{
boss.bell::signal(tier::release, hids::events::focus::set, seed); // Turn on a default downstream branch.
}
else if (allow_focusize)
else
{
auto& route = get_route(seed.gear_id);
if (route.active && seed.focus_type == solo::on) // Cut a downstream focus branch.
if (allow_focusize && route.active && seed.focus_type == solo::on) // Cut a downstream focus branch.
{
route.foreach([&](auto& nexthop){ nexthop->bell::signal(tier::release, hids::events::focus::off, seed); });
route.next.clear();
Expand Down
14 changes: 7 additions & 7 deletions src/netxs/desktopio/input.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ namespace netxs::events::userland

SUBSET_XS( hover )
{
EVENT_XS( enter, input::hids ), // inform the form about the mouse hover.
EVENT_XS( leave, input::hids ), // inform the form about leaving the mouse.
EVENT_XS( enter, input::hids ), // Inform the form about the mouse hover.
EVENT_XS( leave, input::hids ), // Inform the form about leaving the mouse.
};
SUBSET_XS( scroll )
{
Expand Down Expand Up @@ -157,11 +157,11 @@ namespace netxs::events::userland
};
SUBSET_XS( focus )
{
EVENT_XS( set, input::foci ), // release: set focus toward inside; preview: set focus toward outside.
EVENT_XS( off, input::foci ), // release: reset focus toward inside; preview: reset focus toward outside.
EVENT_XS( get, input::foci ), // request: To unfocus and delete focus route.
EVENT_XS( dry, input::foci ), // request: To remove the reference to the specified applet.
EVENT_XS( hop, input::foci ), // request: To change next hop destination. args: seed.what => seed.item.
EVENT_XS( set, input::foci ), // release: Set focus toward inside; preview: set focus toward outside.
EVENT_XS( off, input::foci ), // release: Reset focus toward inside; preview: reset focus toward outside.
EVENT_XS( get, input::foci ), // request: Unfocus and delete focus route.
EVENT_XS( dry, input::foci ), // request: Remove the reference to the specified applet.
EVENT_XS( hop, input::foci ), // request: Change next hop destination. args: seed.what => seed.item.
};
SUBSET_XS( device )
{
Expand Down
2 changes: 1 addition & 1 deletion src/netxs/desktopio/terminal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8025,7 +8025,7 @@ namespace netxs::ui
auto& f = lock.thing;
if (f.state)
{
pro::focus::set(owner_ptr, f.gear_id, f.focus_type, faux);
pro::focus::set(owner_ptr, f.gear_id, f.focus_type);
}
else
{
Expand Down
11 changes: 5 additions & 6 deletions src/vtm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ namespace netxs::app::vtm
{
EVENTPACK( events, ui::e2::extra::slot1 )
{
EVENT_XS( newapp , link ), // request: create new object using specified meniid.
EVENT_XS( apptype , link ), // request: ask app type.
EVENT_XS( handoff , link ), // general: attach spcified intance and return sptr.
EVENT_XS( attached, sptr ), // anycast: inform that the object tree is attached to the world.
GROUP_XS( d_n_d , sptr ), // drag&drop functionality. See tiling manager empty slot and pro::d_n_d.
EVENT_XS( newapp , link ), // request: Create new object using specified meniid.
EVENT_XS( apptype , link ), // request: Ask app type.
EVENT_XS( handoff , link ), // general: Attach spcified intance and return sptr.
EVENT_XS( attached, sptr ), // anycast: Inform that the object tree is attached to the world.
GROUP_XS( d_n_d , sptr ), // Drag&drop functionality. See tiling manager empty slot and pro::d_n_d.
GROUP_XS( gate , sptr ),

SUBSET_XS(d_n_d)
Expand Down Expand Up @@ -1970,7 +1970,6 @@ namespace netxs::app::vtm
if (auto gear_ptr = bell::getref<hids>(seed.gear_id))
{
auto& gear = *gear_ptr;
//seed.item = this->This();
gear.owner.bell::signal(tier::preview, hids::events::focus::off, seed);
}
}
Expand Down

0 comments on commit 7c39f2c

Please sign in to comment.