Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tabbar: Fix startup position #1044

Merged
merged 1 commit into from
Oct 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/child.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ extern void user_command(wstring commands, int n);
extern wstring child_conv_path(wstring, bool adjust_dir);
extern void child_fork(int argc, char * argv[], int moni, bool config_size);
extern void child_set_fork_dir(char *);
extern void setenvi(char * env, int val);
extern void child_launch(int n, int argc, char * argv[], int moni);

#endif
18 changes: 18 additions & 0 deletions src/winmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -5468,6 +5468,24 @@ main(int argc, char *argv[])
trace_winsize("border_style");
}

if (cfg.tabbar && !getenv("MINTTY_DX") && !getenv("MINTTY_DY")) {
HWND wnd_other = FindWindowEx(NULL, wnd,
(LPCTSTR)(uintptr_t)class_atom, NULL);
if (wnd_other) {
if (IsZoomed(wnd_other)) {
setenvi("MINTTY_DX", 0);
setenvi("MINTTY_DY", 0);
} else {
RECT r;
GetWindowRect(wnd_other, &r);
setenvi("MINTTY_X", r.left);
setenvi("MINTTY_Y", r.top);
setenvi("MINTTY_DX", r.right - r.left);
setenvi("MINTTY_DY", r.bottom - r.top);
}
}
}

{
// INT16 to handle multi-monitor negative coordinates properly
INT16 sx = 0, sy = 0, sdx = 1, sdy = 1;
Expand Down