! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Mousepad crashes on click Document > Type de fichier > Others > Defaults
Status:
RESOLVED: FIXED
Product:
Mousepad
Component:
General

Comments

Description blk 2015-07-04 19:26:33 CEST
Mousepad crashes when I click on "Document" > "Type de fichier" > "Others" > "Defaults"

I guess in english it is labeled "Document" > "File Type" > "Others" > "Defaults", my system is Debian 8 with XFCE in french. 

Hope this will help.
Comment 1 Matthew Brush editbugs 2015-07-04 20:09:07 CEST
Confirmed, it does it here to. I have no idea what file type "Defaults" is supposed to be. Will have a look and see why it's crashing.
Comment 2 Andre Miranda editbugs 2015-07-07 02:37:48 CEST
Yeah, this crashes here when the editor is not empty.
GtkSourceView:ERROR:gtksourcecontextengine.c:5902:update_syntax: assertion failed: (state->context != NULL)
Aborted (core dumped)

Mousepad 0.4.0 GTK+2 from Arch Repo.
Comment 3 Matthew Brush editbugs 2015-07-07 02:57:26 CEST
I tried looking into a bit but I haven't yet installed the sources for the GtkSourceView version on my machine.

I wonder if "Defaults" is some weird file type we should just skip/hide/disable it? I don't see it in Gedit's file type selection menu.
Comment 4 Andre Miranda editbugs 2015-07-07 03:01:00 CEST
I'm taking a look at this, so far this is where the crash happens:

GTK2:
https://github.com/GNOME/gtksourceview/blob/gnome-2-30/gtksourceview/gtksourcecontextengine.c#L5902

GTK3:
https://github.com/GNOME/gtksourceview/blob/gnome-3-16/gtksourceview/gtksourcecontextengine.c#L5468

It's weird because in GTK2 there is only "Others", but in GTK3 there is "Others->Default" and "Other->..."
Comment 5 Matthew Brush editbugs 2015-07-07 03:06:46 CEST
Ahhh ... it's a special base language definition, not a real language:

https://git.gnome.org/browse/gtksourceview/tree/data/language-specs/def.lang

Judging by the `hidden=true` attribute in the XML and the existence of this function:

https://developer.gnome.org/gtksourceview/stable/GtkSourceLanguage.html#gtk-source-language-get-hidden

I guess we shouldn't be showing it, but rather checking for non-hidden filetypes to show.
Comment 6 Andre Miranda editbugs 2015-07-07 03:13:33 CEST
Created attachment 6368 
Quick patch

Yep, I wrote this quick patch and it seems to work.
Comment 7 Andre Miranda editbugs 2015-07-07 03:47:26 CEST
Created attachment 6369 
Improved patch

Tested on GTK2 and GTK3.
Comment 8 Matthew Brush editbugs 2015-07-07 04:52:26 CEST
Thanks André, merged as http://git.xfce.org/apps/mousepad/commit/?id=720cf91f7b21864b4d3bb0ce18d96cfa719877ca

blk, if it still gives any grief, feel free to re-open.

Bug #12043

Reported by:
blk
Reported on: 2015-07-04
Last modified on: 2015-07-07

People

Assignee:
Matthew Brush
CC List:
2 users

Version

Target Milestone:
Mousepad 0.2.x

Attachments

Quick patch (633 bytes, patch)
2015-07-07 03:13 CEST , Andre Miranda
no flags
Improved patch (1.36 KB, patch)
2015-07-07 03:47 CEST , Andre Miranda
no flags

Additional information