How to use GTK open dialog box in LibreOffice

Hello,

I have LibreOffice on Debian, with Mate desktop.

I would like LibreOffice to use GTK open dialog box in LibreOffice, instead of its own dialog box.

I've got libreoffice-gtk and libreoffice-gnome packages installed, but I don't have the option in Tools --> General.

LibreOffice only shows me its own open/save dialog box.

Can anyone help me to set it ?

Thank you,

Hi

It seems that LO fails to recognize MATE as GNOME/GTK-based desktop. You can
try running LO like that:

OOO_FORCE_DESKTOP=gnome libreoffice

This way I was able to force GNOME file-picker on my KDE box.

If you would like to force GTK everytime, try adding:

export OOO_FORCE_DESKTOP=gnome

into your ~/.bashrc (or similar, depending on your shell) or ~/.profile (AFAIR
GDM from GNOME 2 read latter file on login; don't know about MATE and I don't
know what login manager you are using).

I think that variable name is quite misleading. Perhaps no one noticed it yet.
Will you be able to find few minutes and file bug report about it on LO
bugzilla? Or at least send message to developers mailing list (maybe it should
be discussed first)?

Hello,

Thank you for these answers. Here are the results.

try running LO like that:

OOO_FORCE_DESKTOP=gnome libreoffice

Works fine. I get gnome open/save dialog boxes.

If you would like to force GTK everytime, try adding:

export OOO_FORCE_DESKTOP=gnome

into your ~/.bashrc

Doesn't work, even after restarting the session.

or ~/.profile

Doesn't work either.

Maybe I didn't paste it at the right place. I've seen there was "if" loops. Should

OOO_FORCE_DESKTOP=gnome libreoffice

be pasted into the looop or at the very end of the file ?

I think that variable name is quite misleading. Perhaps no one noticed it yet.
Will you be able to find few minutes and file bug report about it on LO
bugzilla?
Or at least send message to developers mailing list (maybe it should
be discussed first)?

OK. I'll do when I've solved the problem, so I can give a complete report.

Thank you.

Works, although I get a message :

WARNING: gnome-keyring:: couldn't connect to: /tmp/keyring-uQs6sF/pkcs11: Aucun fichier ou dossier de ce type

(Aucun fichier ou dossier de ce type = No such file or folder)

You are using Debian, right? Which version (you can check in file
/etc/debian_version)? How did you install MATE? It hasn't made it into official
Debian repository yet.

Do you know what login manager you are using? Could you post it's name?
If you don't know, can you post output of command:
  dpkg -l
on the web somewhere? <http://pastebin.com/> or similar page sounds good.

It may be few thousand lines long. You can use command:
  dpkg -l > installed-list.txt
to write it into "installed-list.txt" file in your working directory.

Output of:
  echo $SHELL
in command line/terminal may be useful, too.

Answering these questions may help me narrowing down the problem and come up
with some solutions for you.

As for Warning that you are getting: gnome-keyring is GNOME app to securely
store passwords in a session (i.e. between logging in and logging out).
I *think* that you can ignore that -- it's not that LO will ask you for
password anyway (unless you are writing/reading password-protected documents,
but I am pretty sure that LO does not need gnome-keyring for that).

You are using Debian, right? Which version

Wheezy

How did you install MATE? It hasn't made it into official
Debian repository yet.

with the following repository :

deb http://packages.mate-desktop.org/repo/debian/ wheezy main

Do you know what login manager you are using?

Lightdm (from the Debian main repository, installed with apt-get)

I had gdm, but after having a problem with gdm background (disappeared) I switched to Lightdm. I can try with gdm if that can help.

I do not use LightDM, but I think I have found solution:

1. Your $HOME/.xsessionrc file should have following three lines in it:

if [ -r ~/.profile ]; then
    . ~/.profile
fi

If you don't have ~/.xsessionrc file, simply create it.

(Just in case - $HOME and ~ both means your home directory, that is - in most
cases - /home/your-username/.)

2. In your ~/.profile file, put following line:
OOO_FORCE_DESKTOP=gnome
If you don't have ~/.profile file, again - create it. If you happen to have some
conditional statements or loops in that file, put that line at the very end of
file.

Now log out, log in and try running LO.

Below is explanation/rationale, although you may find it a bit technical:
LightDM on login reads script set in session-wrapper in
/etc/lightdm/lightdm.conf file. On Debian, this is /etc/X11/Xsession.

That script sets up X environment, by reading files in /etc/X11/Xsession.d
directory. One of them sources users' XSESSIONRC file, which is ~/.xsessionrc.

In my solution, I tell to put there statement, that reads ~/.profile if it
exists and is readable. Then I tell to put OOO_FORCE_DESKTOP in that ~/.profile
file.

So, in fact, you could put OOO_FORCE_DESKTOP in ~/.xsessionrc and it should
work. I suggest to put in ~/.profile file, because that way you can have all
environment variables in that one single file. If you ever happen to switch
from LightDM to other graphical login manager, or decide to not use any
graphical login manager at all, all your variables should be in place (or will
be with minimal configuration).

Sorry for some reason I didn't see your message.

If you don't have ~/.xsessionrc file, simply create it.

Done. I've pasted in that new file the following :

if [ -r ~/.profile ]; then
     . ~/.profile
fi

2. In your ~/.profile file, put following line:
OOO_FORCE_DESKTOP=gnome

Done (previously I had the same line but with "export" at the beginning, as you told me last time.

I've removed the "export".

Now log out, log in and try running LO.

It doesn't work.
I will try with the word "export" in ~/.profile

OK

It works fine with

export OOO_FORCE_DESKTOP=gnome

I guess I have to do it on other user sessions.

Thank you for your help. I'm going to post the problem on the developpers mailing list. For the technical part, I will simply copy and paste what you wrote so I don't write mistakes.

OK

It works fine with

export OOO_FORCE_DESKTOP=gnome

Great :slight_smile: .

I guess I have to do it on other user sessions.

If you have more than one user on that machine, you can simply create new file
in /etc/X11/Xsession.d/ directory (you will need root privileges to do that).
Name it, for example, "10LibreOffice" and place that export line in it.

/etc/X11/XSession (which LightDM invokes) script will read all files in
/etc/X11/Xsession.d/ directory every time someone logs in.

It's important to read that file read before 40x11-common_xsessionrc script,
otherwise XSession will read users' .xsessionrc (which may force LO desktop to
KDE or generic) and then overwrite it with GNOME. We don't want that.

You can see order in which files will be read by running command:
  run-parts --list /etc/X11/Xsession.d/

Thank you for your help. I'm going to post the problem on the
developpers mailing list.

I think that there are two problems:
1. LO can't recognize MATE as GTK-based environment.
2. Variable name suggest it's OpenOffice related, while it's for LibreOffice (and
OpenOffice by the way). Maybe this way it is fine, maybe it should change.

Should I add this to my bug report on the developper mailing list ? (Maybe you've seen it if you're suscriber of it)

I am not subscribed to developers mailing list; if I were, I wouldn't ask you
if you can report it there :wink: .

As of first problem, I think that this is simply bug and it can be added to
bugzilla (see https://www.libreoffice.org/get-help/bug/ ).

As for second, I think that developers should discuss it first, since this may
or may not be considered bug.

Hi :slight_smile:
It does sound very buggy to me.  Hopefully an "Easy hack"?
Regards from
Tom :slight_smile:

OK.

Someone has stardted to answer on the developpers mailing list.

I think it's on the way.

Thank you,