"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "gb.gtk/src/gmainwindow.cpp" between
gambas-3.16.2.tar.bz2 and gambas-3.16.3.tar.bz2

About: Gambas is a graphical development environment based on a Basic interpreter with object extensions, a bit like Visual Basic (requires Qt).

gmainwindow.cpp  (gambas-3.16.2.tar.bz2):gmainwindow.cpp  (gambas-3.16.3.tar.bz2)
skipping to change at line 321 skipping to change at line 321
#endif #endif
static gboolean my_key_press_event(GtkWidget *widget, GdkEventKey *event) static gboolean my_key_press_event(GtkWidget *widget, GdkEventKey *event)
{ {
GtkWindow *window = GTK_WINDOW(widget); GtkWindow *window = GTK_WINDOW(widget);
gboolean handled = FALSE; gboolean handled = FALSE;
gboolean propagated = FALSE; gboolean propagated = FALSE;
GtkWidget *focus; GtkWidget *focus;
focus = gtk_window_get_focus(window); focus = gtk_window_get_focus(window);
if (focus) if (focus && gtk_widget_get_realized(focus))
{ {
if (!gtk_widget_get_realized(focus))
return handled;
if (GTK_IS_ENTRY(focus) || GTK_IS_TEXT_VIEW(focus)) if (GTK_IS_ENTRY(focus) || GTK_IS_TEXT_VIEW(focus))
{ {
propagated = TRUE; propagated = TRUE;
handled = gtk_window_propagate_key_event(window, event); handled = gtk_window_propagate_key_event(window, event);
if (handled) if (handled)
return TRUE; return TRUE;
} }
} }
/* handle mnemonics and accelerators */ /* handle mnemonics and accelerators */
handled = gtk_window_activate_key(window, event); handled = gtk_window_activate_key(window, event);
if (handled) if (handled)
return TRUE; return TRUE;
if (!propagated) if (!propagated && gtk_widget_get_realized(focus))
{ {
handled = gtk_window_propagate_key_event(window, event); handled = gtk_window_propagate_key_event(window, event);
if (handled) if (handled)
return TRUE; return TRUE;
} }
/* Chain up, invokes binding set */ /* Chain up, invokes binding set */
GtkWidgetClass *parent_klass = (GtkWidgetClass*)g_type_class_peek(g_type_ parent(GTK_TYPE_WINDOW)); GtkWidgetClass *parent_klass = (GtkWidgetClass*)g_type_class_peek(g_type_ parent(GTK_TYPE_WINDOW));
handled = parent_klass->key_press_event(widget, event); handled = parent_klass->key_press_event(widget, event);
skipping to change at line 903 skipping to change at line 900
} }
drawMask(); drawMask();
if (focus) if (focus)
{ {
//fprintf(stderr, "focus = %s\n", focus->name()); //fprintf(stderr, "focus = %s\n", focus->name());
focus->setFocus(); focus->setFocus();
focus = NULL; focus = NULL;
} }
else
{
gControl *ctrl = this;
for(;;)
{
ctrl = ctrl->nextFocus();
if (!ctrl)
break;
if (ctrl->isReallyVisible() && ctrl->isEnabled()
&& ctrl->canFocus())
{
ctrl->setFocus();
break;
}
if (ctrl == this)
break;
}
}
if (isSkipTaskBar()) if (isSkipTaskBar())
_activate = true; _activate = true;
/*if (arr) /*if (arr)
{ {
fprintf(stderr, "#4\n"); fprintf(stderr, "#4\n");
performArrange(); performArrange();
}*/ }*/
} }
skipping to change at line 974 skipping to change at line 991
present(); present();
} }
else else
gtk_window_unfullscreen(GTK_WINDOW(border)); gtk_window_unfullscreen(GTK_WINDOW(border));
} }
void gMainWindow::center() void gMainWindow::center()
{ {
if (!isTopLevel()) return; if (!isTopLevel()) return;
GdkRectangle rect; #ifdef GTK3
int x, y;
if (!isTopLevel()) return;
#ifdef GTK3
if (MAIN_platform_is_wayland) if (MAIN_platform_is_wayland)
gtk_window_set_position(GTK_WINDOW(border), GTK_WIN_POS_CENTER_ON _PARENT); gtk_window_set_position(GTK_WINDOW(border), GTK_WIN_POS_CENTER_ON _PARENT);
#endif
#endif
GdkRectangle rect;
int x, y;
gtk_widget_realize(border);
gDesktop::availableGeometry(screen(), &rect); gDesktop::availableGeometry(screen(), &rect);
x = rect.x + (rect.width - width()) / 2; x = rect.x + (rect.width - width()) / 2;
y = rect.y + (rect.height - height()) / 2; y = rect.y + (rect.height - height()) / 2;
move(x, y); move(x, y);
} }
bool gMainWindow::isModal() const bool gMainWindow::isModal() const
{ {
skipping to change at line 1017 skipping to change at line 1035
//show(); //show();
setType(GTK_WINDOW_TOPLEVEL); setType(GTK_WINDOW_TOPLEVEL);
gtk_window_set_modal(GTK_WINDOW(border), true); gtk_window_set_modal(GTK_WINDOW(border), true);
setTransientFor(); setTransientFor();
save = _current; save = _current;
_current = this; _current = this;
center();
show(); show();
center();
gtk_grab_add(border); gtk_grab_add(border);
gApplication::enterLoop(this); gApplication::enterLoop(this);
_current = save; _current = save;
gtk_grab_remove(border); gtk_grab_remove(border);
gtk_window_set_modal(GTK_WINDOW(border), false); gtk_window_set_modal(GTK_WINDOW(border), false);
if (!_persistent) if (!_persistent)
destroyNow(); destroyNow();
 End of changes. 10 change blocks. 
12 lines changed or deleted 31 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)