aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gtk/PlatGTK.cxx15
-rw-r--r--gtk/ScintillaGTK.cxx2
2 files changed, 15 insertions, 2 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx
index 18d0ea8bd..7c883e01f 100644
--- a/gtk/PlatGTK.cxx
+++ b/gtk/PlatGTK.cxx
@@ -1621,6 +1621,19 @@ void Window::SetPositionRelative(PRectangle rc, Window relativeTo) {
oy += rc.top;
if (oy < 0)
oy = 0;
+
+ /* do some corrections to fit into screen */
+ int sizex = rc.right - rc.left;
+ int sizey = rc.bottom - rc.top;
+ int screenWidth = gdk_screen_width();
+ int screenHeight = gdk_screen_height();
+ if (sizex > screenWidth)
+ ox = 0; /* the best we can do */
+ else if (ox + sizex > screenWidth)
+ ox = screenWidth - sizex;
+ if (oy + sizey > screenHeight)
+ oy = screenHeight - sizey;
+
gtk_widget_set_uposition(PWidget(id), ox, oy);
#if 0
@@ -1631,7 +1644,7 @@ 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);
+ gtk_widget_set_usize(PWidget(id), sizex, sizey);
}
PRectangle Window::GetClientPosition() {
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index 3344a8684..a75586140 100644
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -1159,7 +1159,7 @@ void ScintillaGTK::CreateCallTipWindow(PRectangle rc) {
gtk_drawing_area_size(GTK_DRAWING_AREA(PWidget(ct.wDraw)),
rc.Width(), rc.Height());
ct.wDraw.Show();
- ct.wCallTip.Show();
+ //ct.wCallTip.Show();
//gtk_widget_set_usize(PWidget(ct.wCallTip), rc.Width(), rc.Height());
gdk_window_resize(PWidget(ct.wCallTip)->window, rc.Width(), rc.Height());
}