JNIEXPORT void JNICALL Java_org_gnome_gdk_GdkWindow_gdk_1window_1set_1accept_1focus ( JNIEnv* env, jclass cls, jlong _self, jboolean _acceptFocus ) { GdkWindow* self; gboolean acceptFocus; // convert parameter self self = (GdkWindow*) _self; // convert parameter acceptFocus acceptFocus = (gboolean) _acceptFocus; // call function gdk_window_set_accept_focus(self, acceptFocus); // cleanup parameter self // cleanup parameter acceptFocus }
JS_EXPORT_API void guide_set_focus(gboolean focus) { GdkWindow* gdkwindow = gtk_widget_get_window (get_container()); gdk_window_set_focus_on_map (gdkwindow, focus); gdk_window_set_accept_focus (gdkwindow, focus); gdk_window_set_override_redirect(gdkwindow, !focus); }
static void clutter_stage_gdk_set_accept_focus (ClutterStageWindow *stage_window, gboolean accept_focus) { ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window); if (stage_gdk->window == NULL) return; gdk_window_set_accept_focus (stage_gdk->window, accept_focus); }
JS_EXPORT_API void osd_set_focus(gboolean focus) { gtk_window_set_focus_on_map (GTK_WINDOW (container), focus); gtk_window_set_accept_focus (GTK_WINDOW (container), focus); gtk_window_set_focus_visible (GTK_WINDOW (container), focus); GdkWindow* gdkwindow = gtk_widget_get_window (container); gdk_window_set_focus_on_map (gdkwindow, focus); gdk_window_set_accept_focus (gdkwindow, focus); gdk_window_set_override_redirect(gdkwindow, !focus); }
void draw_background_by_rect(GtkWidget* widget, struct DisplayInfo info, const gchar* xatom_name) { g_message("[%s], %dx%d(%d,%d)\n", __func__, info.width, info.height, info.x, info.y); gtk_widget_set_size_request(widget, info.width, info.height); gtk_window_move(GTK_WINDOW(widget), info.x, info.y); setup_background(widget,NULL,xatom_name); gtk_widget_realize (widget); GdkWindow* gdkwindow = gtk_widget_get_window (widget); gdk_window_set_accept_focus(gdkwindow,FALSE); gdk_window_set_override_redirect (gdkwindow, TRUE); gtk_widget_show (widget); }
static VALUE gdkwin_set_accept_focus(VALUE self, VALUE accept_focus) { gdk_window_set_accept_focus(_SELF(self), RVAL2CBOOL(accept_focus)); return self; }
void panel_start_gui(panel *p) { ENTER; //gtk_rc_parse_string(transparent_rc); p->topgwin = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_container_set_border_width(GTK_CONTAINER(p->topgwin), 0); gtk_window_set_resizable(GTK_WINDOW(p->topgwin), FALSE); gtk_window_set_wmclass(GTK_WINDOW(p->topgwin), "panel", "trayer"); gtk_window_set_title(GTK_WINDOW(p->topgwin), "panel"); gtk_window_set_position(GTK_WINDOW(p->topgwin), GTK_WIN_POS_CENTER); g_signal_connect ( G_OBJECT(p->topgwin) , "delete-event" , G_CALLBACK(panel_delete_event) , p); g_signal_connect ( G_OBJECT(p->topgwin) , "destroy-event", G_CALLBACK(panel_destroy_event), p); g_signal_connect ( G_OBJECT (p->topgwin), "size-request" , G_CALLBACK(panel_size_req) , p); g_signal_connect ( G_OBJECT (p->topgwin), "size-allocate", G_CALLBACK(panel_size_alloc), p); if (p->transparent) { g_signal_connect (G_OBJECT (p->topgwin), "configure-event", G_CALLBACK(panel_configure_event), p); g_signal_connect (G_OBJECT (p->topgwin), "style-set", G_CALLBACK( panel_style_set), p); } if (p->on_primary) { GdkDisplay *display = gdk_display_get_default (); GdkScreen *screen = gdk_display_get_screen(display, 0); g_signal_connect ( screen, "monitors-changed", G_CALLBACK(panel_monitors_changed), (gpointer)p ); p->monitor = gdk_screen_get_primary_monitor(screen); } gtk_widget_realize(p->topgwin); gdk_window_set_decorations(p->topgwin->window, 0); gtk_widget_set_app_paintable(p->topgwin, TRUE); p->lbox = p->my_box_new(FALSE, 0); gtk_container_set_border_width(GTK_CONTAINER(p->lbox), 0); gtk_container_add(GTK_CONTAINER(p->topgwin), p->lbox); gtk_widget_show(p->lbox); if (p->allign == ALLIGN_RIGHT) { GtkWidget * expander = p->my_box_new(FALSE, 0); gtk_box_pack_start(GTK_BOX(p->lbox), expander, TRUE, TRUE, 0); gtk_widget_show(expander); } p->box = p->my_box_new(FALSE, 1); gtk_container_set_border_width(GTK_CONTAINER(p->box), 1); gtk_box_pack_start(GTK_BOX(p->lbox), p->box, FALSE, TRUE, padding); gtk_widget_show(p->box); // get properties on topgwin p->topGdkWindow = gtk_widget_get_window(p->topgwin); p->topxwin = GDK_WINDOW_XWINDOW(GTK_WIDGET(p->topgwin)->window); bg_init(gdk_helper_display()); /* make our window unfocusable */ gdk_window_set_accept_focus(p->topGdkWindow,False); if (p->setdocktype) { gdk_window_set_type_hint(p->topGdkWindow,GDK_WINDOW_TYPE_HINT_DOCK); } Xclimsg(p->topxwin, a_NET_WM_DESKTOP, 0xFFFFFFFF, 0, 0, 0, 0); /************************/ /* Window Mapping Point */ gtk_widget_show_all(p->topgwin); Xclimsg(p->topxwin, a_NET_WM_DESKTOP, 0xFFFFFFFF, 0, 0, 0, 0); gdk_window_stick ( p->topGdkWindow); gdk_window_set_skip_pager_hint ( p->topGdkWindow, True ); gdk_window_set_skip_taskbar_hint ( p->topGdkWindow, True ); XSelectInput (gdk_helper_display(), GDK_ROOT_WINDOW(), PropertyChangeMask); XSelectInput (gdk_helper_display(), p->topxwin, PropertyChangeMask | FocusChangeMask | StructureNotifyMask); gdk_window_add_filter(gdk_get_default_root_window (), (GdkFilterFunc)panel_wm_events, p); calculate_position(p, distance,distancefrom); gdk_window_move_resize(p->topgwin->window, p->ax, p->ay, p->aw, p->ah); if (p->setstrut) panel_set_wm_strut(p); if (p->lower) XLowerWindow(gdk_helper_display(), p->topxwin); RET(); }