Branch: refs/heads/master
Author: Jiří Techet <techet(a)gmail.com>
Committer: Jiří Techet <techet(a)gmail.com>
Date: Fri, 14 Jun 2024 11:22:19 UTC
Commit: abbe1c984f6da1f1a1fa89851b9d010e5d3a19ae
https://github.com/geany/geany/commit/abbe1c984f6da1f1a1fa89851b9d010e5d3a1…
Log Message:
-----------
Avoid unwanted selection when infobar shows by mouse click in Scintilla
Steps to reporduce:
1. Open file A in Geany
2. In a separate window, edit the same file (using e.g. vi)
3. Click to Geany editor so it regains focus
4. An infobar appears. As it appears, several lines in editor are selected
The selection is caused by the fact that as the same time the editor
is being clicked, Geany checks if the document was modified and shows
the info bar. The info bar makes the Scintilla editor smaller and it
scrolls by the amount of lines corresponding to the height of the
infobar. All this happens in the click handler and for Scintilla it
appears as if the mouse button was presses during the scroll and it makes
the selection.
Showing infobars on idle seems to fix the problem.
Fixes #3906.
Modified Paths:
--------------
src/document.c
Modified: src/document.c
34 lines changed, 26 insertions(+), 8 deletions(-)
===================================================================
@@ -3602,19 +3602,23 @@ static void enable_key_intercept(GeanyDocument *doc, GtkWidget *bar)
}
-static void monitor_reload_file(GeanyDocument *doc)
+static gboolean monitor_reload_file_idle(gpointer data)
{
+ GeanyDocument *doc = data;
+
+ if (doc != document_get_current())
+ return G_SOURCE_REMOVE;
+
if (! doc->changed && file_prefs.reload_clean_doc_on_file_change)
{
document_reload_force(doc, doc->encoding);
- return;
+ return G_SOURCE_REMOVE;
}
- gchar *base_name = g_path_get_basename(doc->file_name);
-
/* show this message only once */
if (doc->priv->info_bars[MSG_TYPE_RELOAD] == NULL)
{
+ gchar *base_name = g_path_get_basename(doc->file_name);
GtkWidget *bar;
bar = document_show_message(doc, GTK_MESSAGE_QUESTION, on_monitor_reload_file_response,
@@ -3628,8 +3632,10 @@ static void monitor_reload_file(GeanyDocument *doc)
protect_document(doc);
doc->priv->info_bars[MSG_TYPE_RELOAD] = bar;
enable_key_intercept(doc, bar);
+ g_free(base_name);
}
- g_free(base_name);
+
+ return G_SOURCE_REMOVE;
}
@@ -3657,8 +3663,13 @@ static void on_monitor_resave_missing_file_response(GtkWidget *bar,
}
-static void monitor_resave_missing_file(GeanyDocument *doc)
+static gboolean monitor_resave_missing_file_idle(gpointer data)
{
+ GeanyDocument *doc = data;
+
+ if (doc != document_get_current())
+ return G_SOURCE_REMOVE;
+
if (doc->priv->info_bars[MSG_TYPE_RESAVE] == NULL)
{
GtkWidget *bar = doc->priv->info_bars[MSG_TYPE_RELOAD];
@@ -3682,6 +3693,8 @@ static void monitor_resave_missing_file(GeanyDocument *doc)
doc->priv->info_bars[MSG_TYPE_RESAVE] = bar;
enable_key_intercept(doc, bar);
}
+
+ return G_SOURCE_REMOVE;
}
@@ -3723,15 +3736,20 @@ gboolean document_check_disk_status(GeanyDocument *doc, gboolean force)
locale_filename = utils_get_locale_from_utf8(doc->file_name);
if (!get_mtime(locale_filename, &mtime))
{
- monitor_resave_missing_file(doc);
+ /* document_check_disk_status() call may be a result of a mouse click
+ * inside Scintilla by which Geany gains focus and showing the info bar
+ * during the mouse click leads to text selection as Scintilla scrolls
+ * because the infobar makes the Scintilla widget smaller. */
+ g_idle_add(monitor_resave_missing_file_idle, doc);
/* doc may be closed now */
ret = TRUE;
}
else if (doc->priv->mtime < mtime)
{
/* make sure the user is not prompted again after he cancelled the "reload file?" message */
doc->priv->mtime = mtime;
- monitor_reload_file(doc);
+ /* see above for the idle call explanation */
+ g_idle_add(monitor_reload_file_idle, doc);
/* doc may be closed now */
ret = TRUE;
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Enrico Tröger <enrico.troeger(a)uvena.de>
Committer: GitHub <noreply(a)github.com>
Date: Sun, 16 Jun 2024 10:45:00 UTC
Commit: 29bd66dc9c341a5ccce6c17e4f5dc5a53298ab98
https://github.com/geany/www.geany.org/commit/29bd66dc9c341a5ccce6c17e4f5dc…
Log Message:
-----------
Merge pull request #51 from eht16/remove_twitter_from_website
Remove references to what was called Twitter once
Modified Paths:
--------------
geany/templates/home.html
page_content/contribute/support.md
Modified: geany/templates/home.html
5 lines changed, 2 insertions(+), 3 deletions(-)
===================================================================
@@ -138,9 +138,8 @@ <h2 class="text-center">Great Community</h2>
platforms including
<a href="{% url "page" "support/mailing-lists" %}">The Mailing Lists</a>,
<a href="https://github.com/geany">Github</a>,
- Matrix <a href="https://matrix.to/#/#geany:matrix.org">#geany:matrix.org</a>,
- <a href="https://social.milchreislieferei.de/@GeanyIDE" rel="me">Mastodon</a> and
- <a href="https://twitter.com/GeanyIDE/">Twitter</a>.</p>
+ Matrix <a href="https://matrix.to/#/#geany:matrix.org">#geany:matrix.org</a> and
+ <a href="https://social.milchreislieferei.de/@GeanyIDE" rel="me">Mastodon</a>.</p>
<p><a class="btn btn-default" href="{% url "page" "contribute" %}">Get Involved »</a>
<a class="btn btn-default" href="{% url "page" "about/donate" %}">Donate »</a></p>
</div>
Modified: page_content/contribute/support.md
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -13,9 +13,9 @@ You can subscribe to the [Geany Users mailing list][1] and answer questions, giv
You can also surf through the bugs reported at the [Github issue tracker][2] and see if you maybe can help users. Some issues reported are not actually bugs and maybe can be solved with your help.
-### Twitter
+### Mastodon / fediverse
-Geany's twitter stream: https://twitter.com/GeanyIDE/
+Geany in the Fediverse: https://social.milchreislieferei.de/@GeanyIDE
[1]: /support/mailing-lists/
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).