Re: Desktop as transient window



The desktop is not a window. It could be in some desktop environments,
but is not always. In fact, in some desktop environments, there is no
desktop window or desktop concept at all. There is no standard
protocol to fetch the desktop window if it exists, either.

The reason that unparented dialogs are discouraged are because in most
cases, dialogs shouldn't just pop up out of the blue -- they should
come from an understandable user action or application window to tie
it back to. Otherwise, you might see a random dialog pop up at some
point without knowing where it came from.

While we can often detect the parent window automatically, there are
sometimes cases where we cannot, and we warn to let you know that this
is one of these cases, so you can go and fix it. It is OK to ignore
that warning.

On Sun, Aug 9, 2015 at 3:57 PM, Igor Korot <ikorot01 gmail com> wrote:
Jasper,

On Sun, Aug 9, 2015 at 6:39 PM, Jasper St. Pierre <jstpierre mecheye net> wrote:
As mentioned, dialogs are designed to be parented to a specific
window. As the warning says, this is discouraged (and might cause
things like Wayland not to work correctly). You can ignore the warning
if you want.

Well, "Desktop" is a window, isn't it?
So why I can't set it to be a parent to a dialog?

And what if I have a dialog-based application? I should be able to set
the parent
to be a "Desktop", right?

Or maybe I just need to get a pointer to a :"Desktop" window and
supply it to that function?
Will it work like this? If yes - what is this function name, if any?

Thank you.


On Sun, Aug 9, 2015 at 3:34 PM, Igor Korot <ikorot01 gmail com> wrote:
Hi, Jasper,

On Sun, Aug 9, 2015 at 3:00 PM, Jasper St. Pierre <jstpierre mecheye net> wrote:
The default transient window is NULL, so you don't have to do anything.

OK, I did call "gtk_window_set_transient_for( dlg, NULL );", but still
got the warning

GtkDialog mapped without a transient parent: This is discouraged.

The thing is: I have my own GtkDialog class and I'm trying to
eliminate this warning...

Thank you.


On Sun, Aug 9, 2015 at 11:59 AM, Igor Korot <ikorot01 gmail com> wrote:
Hi, ALL,
There is a function in GTK - gtk_window_set_transient_for() - which
sets the parent
window for the current one.

Now the question I have is: is it possible to set the parent to become
a Desktop?

Let's say I have an application class and I want to make sure that I
already have a TLW
to pass it to that function. Otherwise I want to use Desktop, because
passing NULL
according to documentation will unset it.

[quote]
Passing NULL for parent unsets the current transient window
[/quote]

and it does not say it what happen if there was no such window in the
first place.
So if I will pass NULL for the parent and the transient is not being
set, will it become
set as a Desktop.

This is not clear from the docs.

Thank you for clarification.
_______________________________________________
gtk-list mailing list
gtk-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-list



--
  Jasper



--
  Jasper



-- 
  Jasper


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