WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: xfce4 mousepad can't search twice  (Read 2256 times)

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
xfce4 mousepad can't search twice
« on: December 26, 2009, 05:44:06 AM »
I use xfce currently this was an annoying bug eventually i switched default text editor to leafpad

to fix either updating to svn version or patching the source should work:

this patch is taken from ubuntu karmic repo
(not tested it yet, i will give it a try at first chance)
Code: [Select]
@@ -0,0 +1,28 @@
+--- mousepad-0.2.16.orig/src/search.c
++++ mousepad-0.2.16/src/search.c
+@@ -210,8 +210,11 @@
+ G_CALLBACK(toggle_sensitivity), NULL);
+ g_signal_connect(G_OBJECT(entry_find), "delete-text",
+ G_CALLBACK(toggle_sensitivity), NULL);
+- if (sd->search.string_find)
++ if (sd->search.string_find) {
+ gtk_entry_set_text(GTK_ENTRY(entry_find), sd->search.string_find);
++ gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog),
++ GTK_RESPONSE_OK, TRUE);
++ }
+
+ gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
+ gtk_entry_set_activates_default(GTK_ENTRY(entry_find), TRUE);
+@@ -275,8 +278,11 @@
+ G_CALLBACK(toggle_sensitivity), NULL);
+ g_signal_connect(G_OBJECT(entry_find), "delete-text",
+ G_CALLBACK(toggle_sensitivity), NULL);
+- if (sd->search.string_find)
++ if (sd->search.string_find) {
+ gtk_entry_set_text(GTK_ENTRY(entry_find), sd->search.string_find);
++ gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog),
++ GTK_RESPONSE_OK, TRUE);
++ }
+ label_replace = gtk_label_new_with_mnemonic(_("Re_place with: "));
+ gtk_misc_set_alignment(GTK_MISC(label_replace), 0, 0.5);
+ gtk_table_attach_defaults(GTK_TABLE(table), label_replace, 0, 1, 1, 2);
--- mousepad-0.2.16.orig/debian/patches/series
+++ mousepad-0.2.16/debian/patches/series
@@ -0,0 +1,3 @@
+00_resensitize-find-button.patch
+01_fix-first-replace.patch
+02_mru-on-save.patch
--- mousepad-0.2.16.orig/debian/patches/01_fix-first-replace.patch
+++ mousepad-0.2.16/debian/patches/01_fix-first-replace.patch
@@ -0,0 +1,36 @@
+diff -Naur mousepad-svn-r29637/src/search.c mousepad/src/search.c
+--- mousepad-svn-r29637/src/search.c 2007-11-16 05:20:21.000000000 +0500
++++ mousepad/src/search.c 2009-03-01 13:03:38.000000000 +0500
+@@ -78,7 +78,7 @@
+ static gint document_replace_real(StructData *sd)
+ {
+ GtkTextIter iter, match_start, match_end;
+- GtkTextMark *mark_init = NULL;
++ GtkTextMark *mark_init = NULL, *mark_start, *mark_end;
+ gboolean res;
+ gint num = 0;
+ GtkWidget *q_dialog = NULL;
+@@ -113,6 +113,11 @@
+ if (num == 0 && q_dialog == NULL)
+ q_dialog = create_dialog_message_question(
+ gtk_widget_get_toplevel(sd->mainwin->textview), _("Replace?"));
++
++ gtk_text_buffer_get_selection_bounds(textbuffer, &match_start, &match_end);
++ mark_start = gtk_text_buffer_create_mark(textbuffer, NULL, &match_start, FALSE);
++ mark_end = gtk_text_buffer_create_mark(textbuffer, NULL, &match_end, FALSE);
++
+ switch (gtk_dialog_run(GTK_DIALOG(q_dialog))) {
+ case GTK_RESPONSE_CANCEL:
+ res = 0;
+@@ -122,6 +127,11 @@
+ case GTK_RESPONSE_NO:
+ continue;
+ }
++
++ gtk_text_buffer_get_iter_at_mark(textbuffer, &match_start, mark_start);
++ gtk_text_buffer_get_iter_at_mark(textbuffer, &match_end, mark_end);
++ gtk_text_buffer_move_mark_by_name(textbuffer, "selection_bound", &match_start);
++ gtk_text_buffer_move_mark_by_name(textbuffer, "insert", &match_end);
+ }
+ gtk_text_buffer_delete_selection(textbuffer, TRUE, TRUE);
+ undo_set_sequency(TRUE);

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: xfce4 mousepad can't search twice
« Reply #1 on: December 26, 2009, 06:12:25 AM »
Hi, let us know the result. When you are convinced with the patched version I will update it ib Xfce.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: xfce4 mousepad can't search twice
« Reply #2 on: December 26, 2009, 06:15:44 AM »
ok

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: xfce4 mousepad can't search twice
« Reply #3 on: December 26, 2009, 08:31:47 AM »
done and tested working fine, where to send now? (i didn't attach here as it is against the rules)

also i want you to know that i am working on some xfce applications and plugins such as
xfmedia, xfburn, xfce4-power-manager, xfce4-task-manager, xfce4-mixer, xfce4-gtk-engine, xfce4panel plugins etc
so far only problem i got xfburn fails to write to disc with an "SCSI I/O error ..." after a few tries kernel paniced
i didn't try it again but i never give up

i tested ubuntu's xfburn it is working well, gonna check diff file to see if they have patched the source

i have already sent midori, the browser of xfce desktop, and gonna send more to extend xfce