<commit_before>#include "ed.h"
#include <imm.h>
#include <process.h>
#include "ctl3d.h"
#include "environ.h"
#include "fnkey.h"
#include "mainframe.h"
#include "reconv.h"
#include "wheel.h"

#define DnDTEST
#include "DnD.h"
#ifdef DnDTEST
text_drop_target tdropt;
#endif

main_frame g_frame;
mouse_wheel g_wheel;

static u_int __stdcall
quit_thread_entry (void *p)
{
  DWORD parent = (DWORD)p;

#define HK_BREAK 1
#define HK_QUIT 2

  RegisterHotKey (0, HK_BREAK, MOD_CONTROL, VK_CANCEL);
  SetTimer (0, 0, 1000, 0);

  int fg = 1;
  int quit_ok = 0;
  int quit_on = 0;

  HWND hwnd_fg;
  MSG msg;
  while (GetMessage (&msg, 0, 0, 0))
    {
      if (msg.hwnd)
        {
          XyzzyTranslateMessage (&msg);
          DispatchMessage (&msg);
        }
      else
        switch (msg.message)
          {
          case WM_TIMER:
            hwnd_fg = GetForegroundWindow ();
            msg.wParam = hwnd_fg ? GetWindowThreadProcessId (hwnd_fg, 0) == parent : 0;<commit_msg>C-g related fix. Quit thread should be 1. #19<commit_after>#include "ed.h"
#include <imm.h>
#include <process.h>
#include "ctl3d.h"
#include "environ.h"
#include "fnkey.h"
#include "mainframe.h"
#include "reconv.h"
#include "wheel.h"

#define DnDTEST
#include "DnD.h"
#ifdef DnDTEST
text_drop_target tdropt;
#endif

main_frame g_frame;
mouse_wheel g_wheel;

static u_int __stdcall
quit_thread_entry (void *p)
{
  DWORD parent = (DWORD)p;

#define HK_BREAK 1
#define HK_QUIT 2

  RegisterHotKey (0, HK_BREAK, MOD_CONTROL, VK_CANCEL);
  SetTimer (0, 0, 1000, 0);

  int fg = 1;
  int quit_ok = 0;
  int quit_on = 0;

  HWND hwnd_fg;
  MSG msg;
  while (GetMessage (&msg, 0, 0, 0))
    {
      if (msg.hwnd)
        {
          XyzzyTranslateMessage (&msg);
          DispatchMessage (&msg);
        }
      else
        switch (msg.message)
          {
          case WM_TIMER:
            hwnd_fg = GetForegroundWindow ();
            msg.wParam = hwnd_fg ? GetWindowThreadProcessId (hwnd_fg, 0) == parent : 0;
            if (!msg.wParam)
              {
                // may be ghost window.
                if (IsHungAppWindow (hwnd_fg))
                  {
                    if (IsHungAppWindow (app.toplev))
                      {
                        msg.wParam = 1;
                      }
                  }
              }
{'fraction_non_alphanumeric': 0.11614853195164077, 'fraction_numerical': 0.018134715025906734, 'mean_word_length': 2.1395663956639566, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1247867', 'n_tokens_mistral': 923, 'n_tokens_neox': 863, 'n_words': 211}