Re: [gedit-list] Adding Tabs On Startup Bug?





On Mon, Aug 30, 2010 at 5:34 AM, Jeff Johnston <jeff.johnston.mn@gmail.com> wrote:
I am adding the ability to load tabs (documents) up on startup for my CodeSlayer plugin. The problem is that if I add them when my plugin is run then gedit starts up with a really small window. I found that the problem is in the gedit_window_create_tab_from_uri() method. Specifically it is the following code that causes the problem:

BTW I think you should use gedit_commands_load_uri/s

Regards. 

    if (!GTK_WIDGET_VISIBLE (window))
    {
        gtk_window_present (GTK_WINDOW (window));
    }

If I comment out the gtk_window_present() method then gedit starts up with the window as the size that I closed it. This code seems to be showing the window if the window is not visible? I am wondering when this would be useful? If it is needed then I am not sure how to get around the issue. And, just to be clear, this is just a problem when adding tabs when my plugin is started. It has something to do with the fact that the plugins are called in the gedit_window_init(). If the tabs are added after the window is created then it works. However, by the time the window is fully initialized my plugin has no way to automatically load up the tabs.

I do see in the gedit.c file that somehow I may be able to pass in a "file_list". However, I am not sure how to get this to work with the API directly. And even if it did that would not really work as well as just using the API directly. When I create the tabs I add metadata to the documents. If I just pass in a list of files then I cannot do that.

The other bit of code that I would like to talk about is in gedit.c where it creates a tab if a "file_list" is not passed in. I am wondering if it would be better to check the tabs to see if any exist. If they do then a blank tab is not created.

Thoughts? I am more than willing to submit a patch if I know what the right thing to do is.

-Jeff Johnston



_______________________________________________
gedit-list mailing list
gedit-list gnome org
http://mail.gnome.org/mailman/listinfo/gedit-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]