Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
7a27f407
Commit
7a27f407
authored
Jan 22, 2022
by
Matan Ziv-Av
Committed by
Tomaz Canabrava
Feb 07, 2022
Browse files
Use TIOCSWINSZ ioctl to set pty's pixel size, so it will be reported to apps using TIOCGWINSZE
parent
f13ac9ca
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/Pty.cpp
View file @
7a27f407
...
...
@@ -11,6 +11,9 @@
// System
#include
<csignal>
#if !defined(Q_OS_WIN)
#include
<sys/ioctl.h>
//ioctl() and TIOCSWINSZ
#endif
#include
<termios.h>
// Qt
...
...
@@ -85,9 +88,23 @@ void Pty::setWindowSize(int columns, int lines)
if
(
pty
()
->
masterFd
()
>=
0
)
{
pty
()
->
setWinSize
(
lines
,
columns
);
#if !defined(Q_OS_WIN)
struct
winsize
w
;
w
.
ws_xpixel
=
_windowWidth
;
w
.
ws_ypixel
=
_windowHeight
;
w
.
ws_col
=
_windowColumns
;
w
.
ws_row
=
_windowLines
;
ioctl
(
pty
()
->
masterFd
(),
TIOCSWINSZ
,
&
w
);
#endif
}
}
void
Pty
::
setPixelSize
(
int
width
,
int
height
)
{
_windowWidth
=
width
;
_windowHeight
=
height
;
}
QSize
Pty
::
windowSize
()
const
{
return
{
_windowColumns
,
_windowLines
};
...
...
src/Pty.h
View file @
7a27f407
...
...
@@ -90,6 +90,7 @@ public:
* used by this teletype.
*/
void
setWindowSize
(
int
columns
,
int
lines
);
void
setPixelSize
(
int
width
,
int
height
);
/** Returns the size of the window used by this teletype. See setWindowSize() */
QSize
windowSize
()
const
;
...
...
@@ -163,6 +164,8 @@ private:
int
_windowColumns
;
int
_windowLines
;
int
_windowWidth
;
int
_windowHeight
;
char
_eraseChar
;
bool
_xonXoff
;
bool
_utf8
;
...
...
src/session/Session.cpp
View file @
7a27f407
...
...
@@ -724,8 +724,9 @@ void Session::sessionAttributeRequest(int id, uint terminator)
}
}
void
Session
::
onViewSizeChange
(
int
/*
height
*/
,
int
/*
width
*/
)
void
Session
::
onViewSizeChange
(
int
height
,
int
width
)
{
_shellProcess
->
setPixelSize
(
width
,
height
);
updateTerminalSize
();
}
...
...
Oswald Buddenhagen
@ossi
mentioned in commit
eb0162ba
·
Mar 07, 2022
mentioned in commit
eb0162ba
mentioned in commit eb0162ba7aadb5f3f1e72109d9702a17a1f890dd
Toggle commit list
Oswald Buddenhagen
@ossi
mentioned in commit
c2c2f8a0
·
May 02, 2022
mentioned in commit
c2c2f8a0
mentioned in commit c2c2f8a0f79b9276396ddf87ad74aff866ee0fd3
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment