Skip to content

Commit 901bb9c

Browse files
authored
Merge pull request #821 from o-sdn-o/gui-bridge
#820: Fix additional screen buffer rendering (win32api)
2 parents 903aea2 + 8da5695 commit 901bb9c

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

src/netxs/apps/desk.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,6 @@ namespace netxs::app::desk
303303
};
304304
boss.on(tier::mouserelease, input::key::RightClick, [&, inst_id](hids& gear)
305305
{
306-
pro::focus::set(boss.This(), gear.id, solo::on);
307306
boss.base::signal(tier::anycast, desk::events::ui::selected, inst_id);
308307
gear.dismiss(true);
309308
});

src/netxs/desktopio/application.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace netxs::app
2222

2323
namespace netxs::app::shared
2424
{
25-
static const auto version = "v2025.09.27";
25+
static const auto version = "v2025.10.03";
2626
static const auto repository = "https://github.com/directvt/vtm";
2727
static const auto usr_config = "~/.config/vtm/settings.xml"s;
2828
static const auto sys_config = "/etc/vtm/settings.xml"s;

src/netxs/desktopio/consrv.hpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2345,8 +2345,12 @@ struct impl : consrv
23452345
{
23462346
if (handle_ptr->link == &uiterm.target)
23472347
{
2348-
if (uiterm.target == &uiterm.normal) unsync |= proc(uiterm.normal);
2349-
else if (uiterm.target == &uiterm.altbuf) unsync |= proc(uiterm.altbuf);
2348+
if (uiterm.target == &uiterm.normal) unsync |= proc(uiterm.normal);
2349+
else
2350+
{
2351+
auto& target_buffer = *(decltype(uiterm.altbuf)*)uiterm.target;
2352+
unsync |= proc(target_buffer);
2353+
}
23502354
return true;
23512355
}
23522356
else
@@ -3839,17 +3843,20 @@ struct impl : consrv
38393843
auto handle_ptr = (hndl*)packet.target;
38403844
if (handle_ptr->link == &uiterm.target) // Restore original buffer mode.
38413845
{
3846+
log("\t restore original buffer mode to ", altmod ? "'altbuf'" : "'normal'");
38423847
auto& console = *uiterm.target;
38433848
if (altmod) uiterm.reset_to_altbuf(console);
38443849
else uiterm.reset_to_normal(console);
38453850
}
38463851
else // Switch to additional buffer.
38473852
{
38483853
auto window_ptr = select_buffer(packet.target);
3854+
log("\t switch to additional buffer (%%)", window_ptr);
38493855
if (!window_ptr) return;
38503856
if (uiterm.target == &uiterm.normal || uiterm.target == &uiterm.altbuf) // Save/update original buffer mode.
38513857
{
38523858
altmod = uiterm.target == &uiterm.altbuf;
3859+
log("\t prev mode was ", altmod ? "'altbuf'" : "'normal'");
38533860
}
38543861
auto& console = *window_ptr;
38553862
uiterm.reset_to_altbuf(console);

src/netxs/desktopio/terminal.hpp

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,12 @@ namespace netxs::ui
627627
{
628628
case 0:
629629
default:
630-
queue.add("\x1b[?1;2;10060c"); // Announce support for \e[?10060h mode.
630+
// 61: VT Level 1 conformance
631+
// 22: Color text
632+
// 28: Rectangular area operations
633+
// 52: Clipboard operations
634+
// 10060: VT2D
635+
queue.add("\x1b[?61;22;28;52;10060c");
631636
break;
632637
}
633638
owner.answer(queue);
@@ -7149,8 +7154,12 @@ namespace netxs::ui
71497154
{
71507155
area.coor = {};
71517156
fragment.area(area);
7152-
if (target == &normal) write_block(normal, fragment, coor, src_area, cell::shaders::full);
7153-
else if (target == &altbuf) write_block(altbuf, fragment, coor, src_area, cell::shaders::full);
7157+
if (target == &normal) write_block(normal, fragment, coor, src_area, cell::shaders::full);
7158+
else
7159+
{
7160+
auto& target_buffer = *(alt_screen*)target;
7161+
write_block(target_buffer, fragment, coor, src_area, cell::shaders::full);
7162+
}
71547163
}
71557164
else
71567165
{
@@ -7930,7 +7939,7 @@ namespace netxs::ui
79307939
else
79317940
{
79327941
if (gear.meta(hids::anyCtrl)) return; // Ctrl+Wheel is reserved for zooming.
7933-
if (altscr && target == &altbuf)
7942+
if (altscr && target != &normal)
79347943
{
79357944
if (gear.whlsi)
79367945
{
@@ -8226,12 +8235,15 @@ namespace netxs::ui
82268235
if (auto width = cooked.length())
82278236
{
82288237
auto& proto = cooked.pick();
8229-
auto& brush = target == &normal ? normal.parser::brush
8230-
: altbuf.parser::brush;
8238+
auto& brush = target->parser::brush;
82318239
cooked.each([&](cell& c){ c.meta(brush); });
82328240
//todo split by char height and do _data2d(...) for each
82338241
if (target == &normal) normal._data(width, proto, fx);
8234-
else altbuf._data(width, proto, fx);
8242+
else
8243+
{
8244+
auto& target_buffer = *(alt_screen*)target;
8245+
target_buffer._data(width, proto, fx);
8246+
}
82358247
}
82368248
}
82378249
// term: Move composition cursor (imebox.caret) inside viewport with wordwrapping.

0 commit comments

Comments
 (0)