How to grab and hide cursor using gtkmm? -
I'm trying to write an application using gtkmm, and I want to hide it from the mouse cursor when focus So the first step I have taken is to hide the mouse cursor when the cursor is above my window, which is successful. But when the mouse is taken out of my window, to prevent it from showing, then I restrict the mouse movement with the mouse cursor back to the center of my graphing area.
To do this I need to know the status of window and the window size, which is easy to use: GDK :: Window :: Match-item and GDK :: window ::. However, if the window is moved, the matching status will not be updated and thus my cursor will fall in the wrong position!
So what are the options for the effect that I can get here?
simply indicator.
// Let windows pass all events separately LEAVE_NOTIFY_MASK MainWindow- & gt; Set_ivents (Gdak_akspozr_mask | GDK_pointr_moshn_mask | GDK_pointr_moshn_hint_mask | GDK_btn_moshn_mask | GDK_buttonl_moshn_mask | GDK_button2_moshn_mask | GDK_button3_moshn_mask | GDK_btn_pres_mask | GDK_btn_riliz_mask | GDK_ke_pres_mask | GDK_ke_riliz_mask | GDK_antr_notifai_mask | GDK_foks_chenj_mask | GDK_strccr_mask | GDK_proprti_chenj_mask | GDK_vijibiliti_notifai_mask | GDK_proksimiti_in_mask | GDK_proksimiti_aut_mask | GDK_substrkture_mask | GDK_scrol_mask | GDK_tc_mask | GDK_smuth_scrol_mask | GDK_toucpd_jescr_mask); MainWindow- & gt; Set_modal (true); Auto display = main wands-> gate_desplay (); Auto Window = Main Window- & gt; Get_window (); Auto drag success = display-> Get_default_seat () - & gt; Catch (window, gdk :: SEAT_CAPABILITY_ALL, true); If (hurry! = GdK :: GRABICAS) {std :: clog & lt; & Lt; "Failed to grab:" & lt; & Lt; Bandesut & lt; & Lt; Std :: endl; }
Comments
Post a Comment