Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
fixed overlay causing lag and removed window border
Browse files Browse the repository at this point in the history
  • Loading branch information
KawaiiKraken committed Dec 27, 2023
1 parent d3413df commit 7e01cd4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/UserInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ void UserInterface::Config(HWND hwnd){
for (int i = 0; i < (limit_ptr_vector.size()); i++) {
String.push_back("");
}
static ImGuiWindowFlags flags = ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize;
static ImGuiWindowFlags flags = ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMove;
ImGui::SetNextWindowPos(ImVec2(0, 0));
ImGui::Begin("config", NULL, flags);

ImGui::SeparatorText("Hotkeys");
Expand Down Expand Up @@ -237,8 +238,9 @@ int UserInterface::run_gui(){
// Calculate the pixel size
int screenWidth = desktopRect.right - desktopRect.left;
int screenHeight = desktopRect.bottom - desktopRect.top;
DWORD dwStyle = WS_VISIBLE | WS_OVERLAPPED | WS_POPUP | WS_BORDER;
HWND hwnd = ::CreateWindowEx(WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_LAYERED, wc.lpszClassName, L"klim config", dwStyle, 0, 0, screenWidth, screenHeight, NULL, NULL, wc.hInstance, NULL);
DWORD dwStyle = WS_VISIBLE | WS_OVERLAPPED | WS_POPUP;
//HWND hwnd = ::CreateWindowEx(WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_LAYERED, wc.lpszClassName, L"klim config", dwStyle, 0, 0, screenWidth, screenHeight, NULL, NULL, wc.hInstance, NULL);
HWND hwnd = ::CreateWindowEx(WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_LAYERED, wc.lpszClassName, L"klim config", dwStyle, 0, 0, 250, 350, NULL, NULL, wc.hInstance, NULL);



Expand Down Expand Up @@ -436,17 +438,6 @@ LRESULT WINAPI UserInterface::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
case WM_KEYUP:
hotkeyInstance->KeyboardInputHandler(static_cast<int>(wParam), false);
break;
case WM_GETMINMAXINFO:
RECT desktopRect;
HWND hDesktop = GetDesktopWindow();
GetWindowRect(hDesktop, &desktopRect);
// Calculate the pixel size
int screenWidth = desktopRect.right - desktopRect.left;
int screenHeight = desktopRect.bottom - desktopRect.top;
MINMAXINFO* minMaxInfo = (MINMAXINFO*)lParam;
minMaxInfo->ptMinTrackSize.x = minMaxInfo->ptMaxTrackSize.x = screenWidth; // size x width
minMaxInfo->ptMinTrackSize.y = minMaxInfo->ptMaxTrackSize.y = screenHeight; // size y height
break;
}
return ::DefWindowProcW(hWnd, msg, wParam, lParam);
}
2 changes: 2 additions & 0 deletions src/UserInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class UserInterface {
Settings* settings;
void Overlay(bool* p_open, HWND hwnd);
void Config(HWND hwnd);
ImVec2 overlayWindowPos;
ImVec2 overlayWindowSize;
};
// font base64, i will find a better way for this at some point... prob
const char Hack_Regular[243650+1] =
Expand Down

0 comments on commit 7e01cd4

Please sign in to comment.