<commit_before>
#include "ImwPlatformWindow.h"

#include "ImwWindowManager.h"

namespace ImWindow
{
//SFF_BEGIN
	ImwPlatformWindow::ImwPlatformWindow(bool bMain, bool bIsDragWindow, bool bCreateState)
	{
		m_bMain = bMain;
		m_bIsDragWindow = bIsDragWindow;
		m_pContainer = new ImwContainer(this);
		m_pState = NULL;
		m_pPreviousState = NULL;
		m_bNeedRender = false;
		m_bShowContent = true;

		if (bCreateState)
		{
			void* pTemp = ImGui::GetInternalState();
			m_pState = ImwMalloc(ImGui::GetInternalStateSize());
			ImGui::SetInternalState(m_pState, true);
			ImGui::GetIO().IniFilename = NULL;
			ImGui::SetInternalState(pTemp);
		}
	}

	ImwPlatformWindow::~ImwPlatformWindow()
	{
		ImwSafeDelete(m_pContainer);

		SetState();
		if (!IsMain())
		{
			ImGui::GetIO().Fonts = NULL;
		}
		ImGui::Shutdown();
		RestoreState();
		ImwSafeFree(m_pState);
	}

	bool ImwPlatformWindow::Init(ImwPlatformWindow* /*pParent*/)
	{
		return true;
	}

	const ImVec2 c_oVec2_0 = ImVec2(0,0);
	ImVec2 ImwPlatformWindow::GetPosition() const
	{
		return c_oVec2_0;<commit_msg>Fix Platformwindow ImGuiState copy<commit_after>
#include "ImwPlatformWindow.h"

#include "ImwWindowManager.h"

namespace ImWindow
{
//SFF_BEGIN
	ImwPlatformWindow::ImwPlatformWindow(bool bMain, bool bIsDragWindow, bool bCreateState)
	{
		m_bMain = bMain;
		m_bIsDragWindow = bIsDragWindow;
		m_pContainer = new ImwContainer(this);
		m_pState = NULL;
		m_pPreviousState = NULL;
		m_bNeedRender = false;
		m_bShowContent = true;

		if (bCreateState)

		{
			void* pTemp = ImGui::GetInternalState();


			ImGuiIO& oCurrentIO = ImGui::GetIO();
			m_pState = ImwMalloc(ImGui::GetInternalStateSize());
			ImGui::SetInternalState(m_pState, true);
			ImGuiIO& oNewIO = ImGui::GetIO();

			memcpy(&((ImGuiState*)m_pState)->IO.KeyMap, &((ImGuiState*)pTemp)->IO.KeyMap, sizeof(int) * ImGuiKey_COUNT);
			oNewIO.RenderDrawListsFn = oCurrentIO.RenderDrawListsFn;
			oNewIO.GetClipboardTextFn = oCurrentIO.GetClipboardTextFn;
			oNewIO.SetClipboardTextFn = oCurrentIO.SetClipboardTextFn;
			oNewIO.MemAllocFn = oCurrentIO.MemAllocFn;
			oNewIO.MemFreeFn = oCurrentIO.MemFreeFn;
			oNewIO.ImeSetInputScreenPosFn = oCurrentIO.ImeSetInputScreenPosFn;
			ImGui::GetIO().IniFilename = NULL;

			ImGui::SetInternalState(pTemp);

		}
	}

	ImwPlatformWindow::~ImwPlatformWindow()
	{
		ImwSafeDelete(m_pContainer);

		SetState();
		if (!IsMain())
		{
			ImGui::GetIO().Fonts = NULL;
		}
		ImGui::Shutdown();
		RestoreState();
		ImwSafeFree(m_pState);
	}

	bool ImwPlatformWindow::Init(ImwPlatformWindow* /*pParent*/)
	{
		return true;
	}

	const ImVec2 c_oVec2_0 = ImVec2(0,0);
	ImVec2 ImwPlatformWindow::GetPosition() const
	{
		return c_oVec2_0;
{'fraction_non_alphanumeric': 0.12495351431759018, 'fraction_numerical': 0.00669393826701376, 'mean_word_length': 5.255813953488372, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1981348', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1034, 'n_words': 154}