Skip to content

Commit

Permalink
Added get pixel size process.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikoto2000 authored and Biswa96 committed Nov 15, 2024
1 parent 5f444e6 commit e3ee07a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/wslbridge2-backend.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ int main(int argc, char *argv[])
s++;
len--;
// ensure 8 more bytes are loaded for winsize
while (readRet > 0 && len < 8)
while (readRet > 0 && len < 16)
{
readRet = recv(ioSockets.inputSock, s + len, 8 - len, 0);
readRet = recv(ioSockets.inputSock, s + len, 16 - len, 0);
if (readRet > 0)
{
len += readRet;
Expand All @@ -272,8 +272,6 @@ int main(int argc, char *argv[])
struct winsize * winsp = (struct winsize *)s;
s += 8;
len -= 8;
winsp->ws_xpixel = 0;
winsp->ws_ypixel = 0;
ret = ioctl(mfd, TIOCSWINSZ, winsp);
if (ret != 0)
perror("ioctl(TIOCSWINSZ)");
Expand All @@ -299,8 +297,6 @@ int main(int argc, char *argv[])
assert(ret > 0);

/* Remove "unused" pixel values ioctl_tty(2) */
winp.ws_xpixel = 0;
winp.ws_ypixel = 0;
ret = ioctl(mfd, TIOCSWINSZ, &winp);
if (ret != 0)
perror("ioctl(TIOCSWINSZ)");
Expand Down

0 comments on commit e3ee07a

Please sign in to comment.