diff options
author | nyamatongwe <unknown> | 2003-04-05 23:51:07 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2003-04-05 23:51:07 +0000 |
commit | 35dd9e73821ef02dee70fbea3f4db7caea70391b (patch) | |
tree | f6a21cc15f80089e87bbdf47b8feb818598cf65f | |
parent | 4069de879da4066b3691156b620c96a9e4d32fc3 (diff) | |
download | scintilla-mirror-35dd9e73821ef02dee70fbea3f4db7caea70391b.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); } |