Branch: refs/heads/master
Author: Matthew Brush <matt(a)geany.org>
Committer: Matthew Brush <matt(a)geany.org>
Date: Sun, 03 Aug 2014 11:23:19 UTC
Commit: 3c2d93eca42d550fe416a9200e6a67a82bcd7afe
https://github.com/geany/geany/commit/3c2d93eca42d550fe416a9200e6a67a82bcd7…
Log Message:
-----------
Refactor win32 native dialog-mainloop update code
Just cleaning up last commit.
Modified Paths:
--------------
src/win32.c
Modified: src/win32.c
74 lines changed, 40 insertions(+), 34 deletions(-)
===================================================================
@@ -83,68 +83,74 @@ static gboolean CreateChildProcess(geany_win32_spawn *gw_spawn, TCHAR *szCmdline
static VOID ReadFromPipe(HANDLE hRead, HANDLE hWrite, HANDLE hFile, GError **error);
+/* The timer handle used to refresh windows below modal native dialogs. If
+ * ever more than one dialog can be shown at a time, this needs to be changed
+ * to be for specific dialogs. */
static UINT_PTR dialog_timer = 0;
+G_INLINE_FUNC void win32_dialog_reset_timer(HWND hwnd)
+{
+ if (G_UNLIKELY(dialog_timer != 0))
+ {
+ KillTimer(hwnd, dialog_timer);
+ dialog_timer = 0;
+ }
+}
+
+
VOID CALLBACK
win32_dialog_update_main_window(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
gint i;
+
+ /* Pump the main window loop a bit, but not enough to lock-up.
+ * The typical `while(gtk_events_pending()) gtk_main_iteration();`
+ * loop causes the entire operating system to lock-up. */
for (i = 0; i < 4 && gtk_events_pending(); i++)
gtk_main_iteration();
- dialog_timer = 0;
-}
-
-VOID CALLBACK win32_dialog_timer_expired(HWND hwnd, UINT msg, UINT_PTR idEvent, DWORD dwTime)
-{
- while (gtk_events_pending())
- gtk_main_iteration();
+ /* Cancel any pending timers since we just did an update */
+ win32_dialog_reset_timer(hwnd);
}
-/* This function is called for OPENFILENAME lpfnHook function and it establishes
- * a timer that is reset each time which will update the main window loop eventually */
-UINT_PTR CALLBACK win32_dialog_explorer_hook_proc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
+G_INLINE_FUNC UINT_PTR win32_dialog_queue_main_window_redraw(HWND dlg, UINT msg,
+ WPARAM wParam, LPARAM lParam, gboolean postpone)
{
switch (msg)
{
+ /* Messages that likely mean the window below a dialog needs to be re-drawn. */
case WM_WINDOWPOSCHANGED:
case WM_MOVE:
case WM_SIZE:
case WM_THEMECHANGED:
- {
- if (dialog_timer != 0)
- KillTimer(dlg, dialog_timer);
- dialog_timer = SetTimer(dlg, 0, 33 /* around 30fps */, win32_dialog_update_main_window);
- }
+ if (postpone)
+ {
+ win32_dialog_reset_timer(dlg);
+ dialog_timer = SetTimer(dlg, 0, 33 /* around 30fps */, win32_dialog_update_main_window);
+ }
+ else
+ win32_dialog_update_main_window(dlg, msg, wParam, lParam);
+ break;
}
return 0; /* always let the default proc handle it */
}
+/* This function is called for OPENFILENAME lpfnHook function and it establishes
+ * a timer that is reset each time which will update the main window loop eventually. */
+UINT_PTR CALLBACK win32_dialog_explorer_hook_proc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ return win32_dialog_queue_main_window_redraw(dlg, msg, wParam, lParam, TRUE);
+}
+
+
/* This function is called for old-school win32 dialogs that accept a proper
- * lpfnHook function for all messages. It doesn't use a timer but instead checks
- * GTK+ events pending and clamps to some arbitrary limit to prevent freeze-ups. */
+ * lpfnHook function for all messages, it doesn't use a timer. */
UINT_PTR CALLBACK win32_dialog_hook_proc(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
- case WM_WINDOWPOSCHANGED:
- case WM_MOVE:
- case WM_SIZE:
- case WM_THEMECHANGED:
- {
- /* Pump the main window loop a bit, but not enough to lock-up.
- * The typical `while(gtk_events_pending()) gtk_main_iteration();`
- * loop causes the entire operating system to lock-up. */
- guint i;
- for (i = 0; i < 4 && gtk_events_pending(); i++)
- gtk_main_iteration();
- break;
- }
- }
- return 0; /* always let the default proc handle it */
+ return win32_dialog_queue_main_window_redraw(dlg, msg, wParam, lParam, FALSE);
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Dominic Hopf <dmaphy(a)googlemail.com>
Committer: Dominic Hopf <dmaphy(a)googlemail.com>
Date: Sat, 02 Aug 2014 21:02:21 UTC
Commit: fc0e8fa56644230aeb4b7cdfde4271280565ce76
https://github.com/geany/geany/commit/fc0e8fa56644230aeb4b7cdfde4271280565c…
Log Message:
-----------
Merge pull request #311 from philippwiesemann/fix-typo-doc
Fix typo in documentation
Modified Paths:
--------------
doc/geany.txt
Modified: doc/geany.txt
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -5139,7 +5139,7 @@ After you are happy with your changes, create a patch e.g. by using::
or even better, by creating a Git-formatted patch which will keep authoring
and description data, by first committing your changes (doing so in a fresh
-new branch is recommended for `matser` not to diverge from upstream) and then
+new branch is recommended for `master` not to diverge from upstream) and then
using git format-patch::
% git checkout -b my-documentation-changes # create a fresh branch
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Philipp Wiesemann <philipp.wiesemann(a)arcor.de>
Committer: Philipp Wiesemann <philipp.wiesemann(a)arcor.de>
Date: Sat, 02 Aug 2014 20:03:34 UTC
Commit: c47c84820e6f48be9eb70261d4d790229b1b3294
https://github.com/geany/geany/commit/c47c84820e6f48be9eb70261d4d790229b1b3…
Log Message:
-----------
Fix typo in documentation
Modified Paths:
--------------
doc/geany.txt
Modified: doc/geany.txt
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -5139,7 +5139,7 @@ After you are happy with your changes, create a patch e.g. by using::
or even better, by creating a Git-formatted patch which will keep authoring
and description data, by first committing your changes (doing so in a fresh
-new branch is recommended for `matser` not to diverge from upstream) and then
+new branch is recommended for `master` not to diverge from upstream) and then
using git format-patch::
% git checkout -b my-documentation-changes # create a fresh branch
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).