Skip to content
Permalink
Browse files

Fix on windows, if you maximise the window then press F11, the window…

… completely disappears instead of going fullscreen
  • Loading branch information
UnknownShadow200 committed Jan 3, 2020
1 parent b7099de commit bf13d69f9a61484360db095ad0fd44bd236e365a
Showing with 11 additions and 11 deletions.
  1. +8 −8 src/LWeb.c
  2. +3 −3 src/Window.c
@@ -182,7 +182,7 @@ void Json_Parse(struct JsonContext* ctx) {
static void Json_Handle(cc_uint8* data, cc_uint32 len,
JsonOnValue onVal, JsonOnNew newArr, JsonOnNew newObj) {
struct JsonContext ctx;
/* NOTE: classicube.net uses \u JSON for non ASCII, no need to UTF8 convert characters */
/* NOTE: classicube.net uses \u JSON for non ASCII, no need to UTF8 convert characters here */
String str = String_Init((char*)data, len, len);
Json_Init(&ctx, &str);

@@ -263,7 +263,7 @@ void GetTokenTask_Run(void) {
*--------------------------------------------------------SignInTask-------------------------------------------------------*
*#########################################################################################################################*/
struct SignInTaskData SignInTask;
char userBuffer[STRING_SIZE];
static char userBuffer[STRING_SIZE];

static void SignInTask_LogError(const String* str) {
if (String_CaselessEqualsConst(str, "username") || String_CaselessEqualsConst(str, "password")) {
@@ -295,20 +295,20 @@ static void SignInTask_Append(String* dst, const char* key, const String* value)
void SignInTask_Run(const String* user, const String* pass) {
static const String id = String_FromConst("CC post login");
static const String url = String_FromConst("https://www.classicube.net/api/login");
String tmp; char tmpBuffer[384];
String args; char argsBuffer[384];
if (SignInTask.Base.working) return;

LWebTask_Reset(&SignInTask.Base);
String_InitArray(SignInTask.username, userBuffer);
SignInTask.error = NULL;

String_InitArray(tmp, tmpBuffer);
SignInTask_Append(&tmp, "username=", user);
SignInTask_Append(&tmp, "&password=", pass);
SignInTask_Append(&tmp, "&token=", &GetTokenTask.token);
String_InitArray(args, argsBuffer);
SignInTask_Append(&args, "username=", user);
SignInTask_Append(&args, "&password=", pass);
SignInTask_Append(&args, "&token=", &GetTokenTask.token);

SignInTask.Base.identifier = id;
Http_AsyncPostData(&url, false, &id, tmp.buffer, tmp.length, &ccCookies);
Http_AsyncPostData(&url, false, &id, args.buffer, args.length, &ccCookies);
SignInTask.Base.Handle = SignInTask_Handle;
}

@@ -492,10 +492,10 @@ void Window_Show(void) {
}

int Window_GetWindowState(void) {
DWORD style = GetWindowLong(win_handle, GWL_STYLE);
DWORD s = GetWindowLong(win_handle, GWL_STYLE);

if (style & WS_MINIMIZE) return WINDOW_STATE_MINIMISED;
if (style & (WS_MAXIMIZE | WS_POPUP)) return WINDOW_STATE_FULLSCREEN;
if ((s & WS_MINIMIZE)) return WINDOW_STATE_MINIMISED;
if ((s & WS_MAXIMIZE) && (s & WS_POPUP)) return WINDOW_STATE_FULLSCREEN;
return WINDOW_STATE_NORMAL;
}

0 comments on commit bf13d69

Please sign in to comment.
You can’t perform that action at this time.