Re: How does one get the screen coordinates of the workspace?

2015-12-29 Thread Jim Charlton
I use gtkmm and get screen size before opening the application window in 
order to make sure it fits on the display.  the equivalent gtk/gdk calls 
(I think)  use gtk_window_get_screen() to get the gdk window from 
the gtk window.  Then from the gdk window I use gdk_window_get_height() 
to get the height, and then gtk_window_resize() to resize the original 
gtk window to fit.


It has been a while since I looked at the code... but I think that was it.

jim...

On 15-12-29 02:26 PM, Rick Berger wrote:
I'm looking for to get the screen coordinates, height and width of the 
workspace on Ubuntu's desktop. The only way I see to doing this, is in 
starting the app: maximize its window; get the workspace info from its 
window's coordinates and dimensions; then un-maximize its window. I 
believe these can be done with GDK.


Is there better way to do this?

Rick
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: How does one get the screen coordinates of the workspace?

2015-12-29 Thread Gergely Polonkai
Hello,

this makes me wonder why you need these coordinates?

If you want to set the window size to the maximum, then just maximize it.

If you want to move it around automatically, like put it on the center of
the screen, don't do that. There are situations, e.g. for users with
multiple monitors of diyzfferent sizes, when you do more harm than good
with this approach.

Best,
Gergely
On Dec 29, 2015 11:26 PM, "Rick Berger"  wrote:

> I'm looking for to get the screen coordinates, height and width of the
> workspace on Ubuntu's desktop. The only way I see to doing this, is in
> starting the app: maximize its window; get the workspace info from its
> window's coordinates and dimensions; then un-maximize its window. I believe
> these can be done with GDK.
>
> Is there better way to do this?
>
> Rick
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: How does one get the screen coordinates of the workspace?

2015-12-29 Thread Stefan Salewski
On Tue, 2015-12-29 at 17:26 -0500, Rick Berger wrote:
> I'm looking for to get the screen coordinates, height and width of the
> workspace on Ubuntu's desktop. The only way I see to doing this, is in
> starting the app: maximize its window; get the workspace info from its
> window's coordinates and dimensions; then un-maximize its window. I 
> believe these can be done with GDK.
> 
> Is there better way to do this?
> 

I can remember that exactly that was a minimal example for my Nim GDK3
bindings. See

https://github.com/StefanSalewski/nim-gdk3/blob/master/test/test.nim

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: How does one get the screen coordinates of the workspace?

2015-12-29 Thread Rick Berger
Thanks for the suggestions, the GDK call that works follows, but I 
should of gave more background. My app is a suggester window which 
follows the cursor of different app, a text editor.  So I need to know 
the workspace boundaries to figure out were I have space around the 
editor's cursor to present the suggester window. An obvious situation is 
when the editor's cursor gets to the bottom of the screen the suggester 
will have to float along above it. All this is in C and uses shared 
memory for communication between the apps.


GdkRectangle workSpace;
gdk_screen_get_monitor_workarea(gdk_screen_get_default(), 0, 
);


Rick

On 15-12-29 05:26 PM, Rick Berger wrote:
I'm looking for to get the screen coordinates, height and width of the 
workspace on Ubuntu's desktop. The only way I see to doing this, is in 
starting the app: maximize its window; get the workspace info from its 
window's coordinates and dimensions; then un-maximize its window. I 
believe these can be done with GDK.


Is there better way to do this?

Rick


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list