mirror of
https://github.com/akuker/RASCSI.git
synced 2024-06-14 14:29:33 +00:00
Blank flashing cursor when powerview is enabled
This commit is contained in:
parent
c0a9a73ea1
commit
a05c7d795d
|
@ -106,17 +106,52 @@ SCSIPowerView::SCSIPowerView() : Disk("SCPV")
|
||||||
this->m_powerview_resolution_x = 624;
|
this->m_powerview_resolution_x = 624;
|
||||||
this->m_powerview_resolution_y = 840;
|
this->m_powerview_resolution_y = 840;
|
||||||
|
|
||||||
|
fbcon_cursor(false);
|
||||||
|
fbcon_blank(false);
|
||||||
ClearFrameBuffer();
|
ClearFrameBuffer();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Enable/Disable the framebuffer flashing cursor
|
||||||
|
// From: https://linux-arm-kernel.infradead.narkive.com/XL0ylAHW/turn-off-framebuffer-cursor
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
void SCSIPowerView::fbcon_cursor(bool blank)
|
||||||
|
{
|
||||||
|
int fd = open("/dev/tty1", O_RDWR);
|
||||||
|
if (0 < fd)
|
||||||
|
{
|
||||||
|
write(fd, "\033[?25", 5);
|
||||||
|
write(fd, blank ? "h" : "l", 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOGWARN("%s Unable to open /dev/tty1", __PRETTY_FUNCTION__);
|
||||||
|
}
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Enable/disable the framebuffer blanking
|
||||||
|
// From: https://linux-arm-kernel.infradead.narkive.com/XL0ylAHW/turn-off-framebuffer-cursor
|
||||||
|
//
|
||||||
|
//---------------------------------------------------------------------------
|
||||||
|
void SCSIPowerView::fbcon_blank(bool blank)
|
||||||
|
{
|
||||||
|
int ret = ioctl(fbfd, FBIOBLANK, blank ? VESA_POWERDOWN : VESA_NO_BLANKING);
|
||||||
|
if(ret < 0){
|
||||||
|
LOGWARN("%s Unable to disable blanking", __PRETTY_FUNCTION__);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
SCSIPowerView::~SCSIPowerView()
|
SCSIPowerView::~SCSIPowerView()
|
||||||
{
|
{
|
||||||
// // TAP driver release
|
// Re-enable the cursor
|
||||||
// if (m_tap) {
|
fbcon_cursor(true);
|
||||||
// m_tap->Cleanup();
|
|
||||||
// delete m_tap;
|
|
||||||
// }
|
|
||||||
|
|
||||||
munmap(this->fb, this->fbsize);
|
munmap(this->fb, this->fbsize);
|
||||||
close(this->fbfd);
|
close(this->fbfd);
|
||||||
|
|
|
@ -55,6 +55,9 @@ private:
|
||||||
DWORD m_powerview_resolution_x;
|
DWORD m_powerview_resolution_x;
|
||||||
DWORD m_powerview_resolution_y;
|
DWORD m_powerview_resolution_y;
|
||||||
|
|
||||||
|
void fbcon_cursor(bool blank);
|
||||||
|
void fbcon_blank(bool blank);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SCSIPowerView();
|
SCSIPowerView();
|
||||||
~SCSIPowerView();
|
~SCSIPowerView();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user