diff options
author | nyamatongwe <devnull@localhost> | 2003-04-05 23:51:07 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2003-04-05 23:51:07 +0000 |
commit | a80a4319f6120426e390d8677ab56db3c93fd396 (patch) | |
tree | f6a21cc15f80089e87bbdf47b8feb818598cf65f | |
parent | da9d8766b5e3ce5efecba5d01ff4da6e295835e3 (diff) | |
download | scintilla-mirror-a80a4319f6120426e390d8677ab56db3c93fd396.tar.gz |
Ensure positioning windows does not make them move before 0 in either x or
y as that leads to them appearing at 0,0.
-rw-r--r-- | gtk/PlatGTK.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 016e1b1d2..aa0fb3659 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -7,7 +7,6 @@ #include <stdio.h> #include <stdlib.h> #include <stddef.h> -#define assert(c) ((c) ? (void)(0) : Platform::Assert(#c, __FILE__, __LINE__)) #include <glib.h> #include <gdk/gdk.h> @@ -1448,8 +1447,13 @@ void Window::SetPositionRelative(PRectangle rc, Window relativeTo) { int ox = 0; int oy = 0; gdk_window_get_origin(PWidget(relativeTo.id)->window, &ox, &oy); - - gtk_widget_set_uposition(PWidget(id), rc.left + ox, rc.top + oy); + ox += rc.left; + if (ox < 0) + ox = 0; + oy += rc.top; + if (oy < 0) + oy = 0; + gtk_widget_set_uposition(PWidget(id), ox, oy); #if 0 GtkAllocation alloc; @@ -1459,7 +1463,6 @@ void Window::SetPositionRelative(PRectangle rc, Window relativeTo) { alloc.height = rc.bottom - rc.top; gtk_widget_size_allocate(id, &alloc); #endif - gtk_widget_set_usize(PWidget(id), rc.right - rc.left, rc.bottom - rc.top); } |