Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Archive
vinagre
Commits
04e7a59f
Commit
04e7a59f
authored
Jun 25, 2010
by
Jonh Wendell
Browse files
Build with GSEAL. Closes #615407.
parent
24f0b3ef
Changes
12
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
04e7a59f
...
...
@@ -74,7 +74,7 @@ GNOME_DOC_INIT
#*******************************************************************************
GLIB_REQUIRED=2.17.0
GTK_REQUIRED=2.2
0.0
GTK_REQUIRED=2.2
1.3
GCONF_REQUIRED=2.16.0
GTHREAD_REQUIRED=2.0.0
GTK_VNC_REQUIRED=0.3.10
...
...
plugins/vnc/vinagre-vnc-tab.c
View file @
04e7a59f
...
...
@@ -577,7 +577,7 @@ vnc_pointer_ungrab_cb (VncDisplay *vnc, VinagreVncTab *vnc_tab)
static
void
vnc_bell_cb
(
VncDisplay
*
vnc
,
VinagreVncTab
*
vnc_tab
)
{
gdk_window_beep
(
GTK_WIDGET
(
vnc_tab
)
->
window
);
gdk_window_beep
(
gtk_widget_get_window
(
GTK_WIDGET
(
vnc_tab
)
)
);
}
static
void
...
...
vinagre/vinagre-app.c
View file @
04e7a59f
...
...
@@ -206,7 +206,7 @@ vinagre_app_get_active_window (VinagreApp *app)
* first one shows its window.
*/
if
(
!
GTK_WIDGET_REALIZED
(
GTK_WIDGET
(
app
->
priv
->
active_window
)))
if
(
!
gtk_widget_get_realized
(
GTK_WIDGET
(
app
->
priv
->
active_window
)))
gtk_widget_realize
(
GTK_WIDGET
(
app
->
priv
->
active_window
));
return
app
->
priv
->
active_window
;
...
...
@@ -249,8 +249,8 @@ is_in_viewport (VinagreWindow *window,
return
FALSE
;
/* Check for viewport match */
gdk_window_get_position
(
GTK_WIDGET
(
window
)
->
window
,
&
x
,
&
y
);
gdk_drawable_get_size
(
GTK_WIDGET
(
window
)
->
window
,
&
width
,
&
height
);
gdk_window_get_position
(
gtk_widget_get_window
(
GTK_WIDGET
(
window
)
)
,
&
x
,
&
y
);
gdk_drawable_get_size
(
gtk_widget_get_window
(
GTK_WIDGET
(
window
)
)
,
&
width
,
&
height
);
vinagre_utils_get_current_viewport
(
screen
,
&
vp_x
,
&
vp_y
);
x
+=
vp_x
;
y
+=
vp_y
;
...
...
vinagre/vinagre-applet.c
View file @
04e7a59f
...
...
@@ -99,34 +99,40 @@ vinagre_applet_get_icon (VinagreApplet *applet)
static
void
vinagre_applet_check_size
(
VinagreApplet
*
applet
)
{
GtkAllocation
allocation
;
gtk_widget_get_allocation
(
GTK_WIDGET
(
applet
),
&
allocation
);
/* we don't use the size function here, but the yet allocated size because the
size value is false (kind of rounded) */
if
(
PANEL_APPLET_VERTICAL
(
panel_applet_get_orient
(
PANEL_APPLET
(
applet
))))
{
if
(
applet
->
size
!=
GTK_WIDGET
(
applet
)
->
allocation
.
width
)
if
(
applet
->
size
!=
allocation
.
width
)
{
applet
->
size
=
GTK_WIDGET
(
applet
)
->
allocation
.
width
;
applet
->
size
=
allocation
.
width
;
vinagre_applet_get_icon
(
applet
);
gtk_widget_set_size_request
(
GTK_WIDGET
(
applet
),
applet
->
size
,
applet
->
icon_height
+
2
);
}
/* Adjusting in case the icon size has changed */
if
(
GTK_WIDGET
(
applet
)
->
allocation
.
height
<
applet
->
icon_height
+
2
)
gtk_widget_get_allocation
(
GTK_WIDGET
(
applet
),
&
allocation
);
if
(
allocation
.
height
<
applet
->
icon_height
+
2
)
{
gtk_widget_set_size_request
(
GTK_WIDGET
(
applet
),
applet
->
size
,
applet
->
icon_height
+
2
);
}
}
else
{
if
(
applet
->
size
!=
GTK_WIDGET
(
applet
)
->
allocation
.
height
)
if
(
applet
->
size
!=
allocation
.
height
)
{
applet
->
size
=
GTK_WIDGET
(
applet
)
->
allocation
.
height
;
applet
->
size
=
allocation
.
height
;
vinagre_applet_get_icon
(
applet
);
gtk_widget_set_size_request
(
GTK_WIDGET
(
applet
),
applet
->
icon_width
+
2
,
applet
->
size
);
}
/* Adjusting in case the icon size has changed */
if
(
GTK_WIDGET
(
applet
)
->
allocation
.
width
<
applet
->
icon_width
+
2
)
gtk_widget_get_allocation
(
GTK_WIDGET
(
applet
),
&
allocation
);
if
(
allocation
.
width
<
applet
->
icon_width
+
2
)
{
gtk_widget_set_size_request
(
GTK_WIDGET
(
applet
),
applet
->
icon_width
+
2
,
applet
->
size
);
}
...
...
@@ -140,12 +146,14 @@ vinagre_applet_draw_cb (VinagreApplet *applet)
GdkColor
color
;
GdkGC
*
gc
;
GdkPixmap
*
background
;
GtkAllocation
allocation
;
GdkWindow
*
window
=
gtk_widget_get_window
(
GTK_WIDGET
(
applet
));
if
(
GTK_WIDGET
(
applet
)
->
window
==
NULL
)
if
(
window
==
NULL
)
return
FALSE
;
/* Clear the window so we can draw on it later */
gdk_window_clear
(
GTK_WIDGET
(
applet
)
->
window
);
gdk_window_clear
(
window
);
/* retrieve applet size */
vinagre_applet_get_icon
(
applet
);
...
...
@@ -157,17 +165,18 @@ vinagre_applet_draw_cb (VinagreApplet *applet)
if
(
applet
->
icon
==
NULL
)
return
FALSE
;
w
=
GTK_WIDGET
(
applet
)
->
allocation
.
width
;
h
=
GTK_WIDGET
(
applet
)
->
allocation
.
height
;
gtk_widget_get_allocation
(
GTK_WIDGET
(
applet
),
&
allocation
);
w
=
allocation
.
width
;
h
=
allocation
.
height
;
gc
=
gdk_gc_new
(
GTK_WIDGET
(
applet
)
->
window
);
gc
=
gdk_gc_new
(
window
);
/* draw pixmap background */
bg_type
=
panel_applet_get_background
(
PANEL_APPLET
(
applet
),
&
color
,
&
background
);
if
(
bg_type
==
PANEL_PIXMAP_BACKGROUND
)
{
/* fill with given background pixmap */
gdk_draw_drawable
(
GTK_WIDGET
(
applet
)
->
window
,
gc
,
background
,
0
,
0
,
0
,
0
,
w
,
h
);
gdk_draw_drawable
(
window
,
gc
,
background
,
0
,
0
,
0
,
0
,
w
,
h
);
}
/* draw color background */
...
...
@@ -175,11 +184,11 @@ vinagre_applet_draw_cb (VinagreApplet *applet)
{
gdk_gc_set_rgb_fg_color
(
gc
,
&
color
);
gdk_gc_set_fill
(
gc
,
GDK_SOLID
);
gdk_draw_rectangle
(
GTK_WIDGET
(
applet
)
->
window
,
gc
,
TRUE
,
0
,
0
,
w
,
h
);
gdk_draw_rectangle
(
window
,
gc
,
TRUE
,
0
,
0
,
w
,
h
);
}
/* draw icon at center */
gdk_draw_pixbuf
(
GTK_WIDGET
(
applet
)
->
window
,
gc
,
applet
->
icon
,
gdk_draw_pixbuf
(
window
,
gc
,
applet
->
icon
,
0
,
0
,
(
w
-
applet
->
icon_width
)
/
2
,
(
h
-
applet
->
icon_height
)
/
2
,
applet
->
icon_width
,
applet
->
icon_height
,
GDK_RGB_DITHER_NONE
,
0
,
0
);
...
...
@@ -219,9 +228,10 @@ menu_position (GtkMenu *menu,
{
int
applet_height
,
applet_width
;
GtkRequisition
requisition
;
GdkWindow
*
window
=
gtk_widget_get_window
(
applet
);
gdk_window_get_origin
(
applet
->
window
,
x
,
y
);
gdk_drawable_get_size
(
applet
->
window
,
&
applet_width
,
&
applet_height
);
gdk_window_get_origin
(
window
,
x
,
y
);
gdk_drawable_get_size
(
window
,
&
applet_width
,
&
applet_height
);
gtk_widget_size_request
(
GTK_WIDGET
(
menu
),
&
requisition
);
switch
(
panel_applet_get_orient
(
PANEL_APPLET
(
applet
)))
...
...
vinagre/vinagre-bacon.c
View file @
04e7a59f
...
...
@@ -166,13 +166,13 @@ vinagre_bacon_message_received (const char *message,
* terminal. We also need to make sure that the window
* has been realized otherwise it will not work. lame.
*/
if
(
!
GTK_WIDGET
_REALIZED
(
window
))
if
(
!
gtk_widget_get_realized
(
GTK_WIDGET
(
window
))
)
gtk_widget_realize
(
GTK_WIDGET
(
window
));
if
(
startup_timestamp
<=
0
)
startup_timestamp
=
gdk_x11_get_server_time
(
GTK_WIDGET
(
window
)
->
window
);
startup_timestamp
=
gdk_x11_get_server_time
(
gtk_widget_get_window
GTK_WIDGET
(
(
window
)
)
);
gdk_x11_window_set_user_time
(
GTK_WIDGET
(
window
)
->
window
,
gdk_x11_window_set_user_time
(
gtk_widget_get_window
(
GTK_WIDGET
(
window
)
)
,
startup_timestamp
);
gtk_window_present
(
GTK_WINDOW
(
window
));
...
...
vinagre/vinagre-commands.c
View file @
04e7a59f
...
...
@@ -250,7 +250,7 @@ vinagre_cmd_view_show_toolbar (GtkAction *action,
vinagre_cache_prefs_set_boolean
(
"window"
,
"toolbar-visible"
,
GTK_WIDGET_VISIBLE
(
window
->
priv
->
toolbar
));
gtk_widget_get_visible
(
window
->
priv
->
toolbar
));
}
void
...
...
@@ -263,7 +263,7 @@ vinagre_cmd_view_show_statusbar (GtkAction *action,
vinagre_cache_prefs_set_boolean
(
"window"
,
"statusbar-visible"
,
GTK_WIDGET_VISIBLE
(
window
->
priv
->
statusbar
));
gtk_widget_get_visible
(
window
->
priv
->
statusbar
));
}
void
...
...
@@ -276,7 +276,7 @@ vinagre_cmd_view_show_fav_panel (GtkAction *action,
vinagre_cache_prefs_set_boolean
(
"window"
,
"side-panel-visible"
,
GTK_WIDGET_VISIBLE
(
window
->
priv
->
fav_panel
));
gtk_widget_get_visible
(
window
->
priv
->
fav_panel
));
}
void
...
...
vinagre/vinagre-fav.c
View file @
04e7a59f
...
...
@@ -221,6 +221,7 @@ menu_position (GtkMenu *menu,
gint
wx
,
wy
;
GtkRequisition
requisition
;
GtkWidget
*
w
;
GtkAllocation
allocation
;
w
=
fav
->
priv
->
tree
;
path
=
get_current_path
(
fav
);
...
...
@@ -233,17 +234,18 @@ menu_position (GtkMenu *menu,
wx
=
rect
.
x
;
wy
=
rect
.
y
;
gdk_window_get_origin
(
w
->
window
,
x
,
y
);
gdk_window_get_origin
(
gtk_widget_get_
window
(
w
)
,
x
,
y
);
gtk_widget_size_request
(
GTK_WIDGET
(
menu
),
&
requisition
);
gtk_widget_get_allocation
(
w
,
&
allocation
);
if
(
gtk_widget_get_direction
(
w
)
==
GTK_TEXT_DIR_RTL
)
*
x
+=
w
->
allocation
.
x
+
w
->
allocation
.
width
-
requisition
.
width
-
10
;
*
x
+=
allocation
.
x
+
allocation
.
width
-
requisition
.
width
-
10
;
else
*
x
+=
w
->
allocation
.
x
+
10
;
*
x
+=
allocation
.
x
+
10
;
wy
=
MAX
(
*
y
+
5
,
*
y
+
wy
+
5
);
wy
=
MIN
(
wy
,
*
y
+
w
->
allocation
.
height
-
requisition
.
height
-
5
);
wy
=
MIN
(
wy
,
*
y
+
allocation
.
height
-
requisition
.
height
-
5
);
*
y
=
wy
;
...
...
@@ -726,12 +728,12 @@ drag_data_received_handl (GtkWidget *widget,
gchar
*
_sdata
;
gboolean
success
=
FALSE
;
if
((
selection_data
!=
NULL
)
&&
(
selection_data
->
length
>=
0
))
if
((
selection_data
!=
NULL
)
&&
(
gtk_
selection_data
_get_
length
(
selection_data
)
>=
0
))
{
switch
(
target_type
)
{
case
TARGET_VINAGRE
:
_sdata
=
(
gchar
*
)
selection_data
->
data
;
_sdata
=
(
gchar
*
)
gtk_
selection_data
_get_data
(
selection_
data
)
;
success
=
TRUE
;
break
;
...
...
@@ -788,12 +790,14 @@ drag_drop_handl (GtkWidget *widget,
{
gboolean
is_valid_drop_site
;
GdkAtom
target_type
;
GList
*
targets
;
is_valid_drop_site
=
FALSE
;
targets
=
gdk_drag_context_list_targets
(
context
);
if
(
context
->
targets
)
if
(
targets
)
{
target_type
=
GDK_POINTER_TO_ATOM
(
g_list_nth_data
(
context
->
targets
,
TARGET_VINAGRE
));
target_type
=
GDK_POINTER_TO_ATOM
(
g_list_nth_data
(
targets
,
TARGET_VINAGRE
));
gtk_drag_get_data
(
widget
,
context
,
target_type
,
...
...
vinagre/vinagre-notebook.c
View file @
04e7a59f
...
...
@@ -178,7 +178,7 @@ drag_data_get_handl (GtkWidget *widget,
/*FIXME: Set other properties of the connection*/
gtk_selection_data_set
(
selection_data
,
selection_data
->
target
,
gtk_
selection_data
_get_
target
(
selection_data
)
,
8
,
(
guchar
*
)
data
,
strlen
(
data
));
...
...
vinagre/vinagre-plugins-engine.c
View file @
04e7a59f
...
...
@@ -861,13 +861,7 @@ vinagre_plugins_engine_configure_plugin (VinagrePluginsEngine *engine,
gtk_window_set_transient_for
(
GTK_WINDOW
(
conf_dlg
),
parent
);
wg
=
parent
->
group
;
if
(
wg
==
NULL
)
{
wg
=
gtk_window_group_new
();
gtk_window_group_add_window
(
wg
,
parent
);
}
wg
=
gtk_window_get_group
(
parent
);
gtk_window_group_add_window
(
wg
,
GTK_WINDOW
(
conf_dlg
));
...
...
vinagre/vinagre-tab.c
View file @
04e7a59f
...
...
@@ -270,10 +270,10 @@ active_connections_button_clicked (GtkToolButton *button,
gtk_image_menu_item_set_image
(
GTK_IMAGE_MENU_ITEM
(
item
),
image
);
label
=
vinagre_connection_get_best_name
(
conn
);
if
((
l
->
data
==
tab
)
&&
(
GTK_IS_LABEL
(
GTK_BIN
(
item
)
->
child
)))
if
((
l
->
data
==
tab
)
&&
(
GTK_IS_LABEL
(
gtk_bin_get_child
(
GTK_BIN
(
item
)
)
)))
{
str
=
g_strdup_printf
(
"<b>%s</b>"
,
label
);
gtk_label_set_use_markup
(
GTK_LABEL
(
GTK_BIN
(
item
)
->
child
),
TRUE
);
gtk_label_set_use_markup
(
GTK_LABEL
(
gtk_bin_get_child
GTK_BIN
(
item
)),
TRUE
);
g_free
(
label
);
label
=
str
;
}
...
...
@@ -316,7 +316,7 @@ setup_layout (VinagreTab *tab)
tab
->
priv
->
toolbar
=
gtk_toolbar_new
();
gtk_toolbar_set_show_arrow
(
GTK_TOOLBAR
(
tab
->
priv
->
toolbar
),
FALSE
);
GTK_WIDGET_SET_FLAGS
(
tab
->
priv
->
toolbar
,
GTK_NO_SHOW_ALL
);
gtk_widget_set_no_show_all
(
tab
->
priv
->
toolbar
,
TRUE
);
gtk_toolbar_set_style
(
GTK_TOOLBAR
(
tab
->
priv
->
toolbar
),
GTK_TOOLBAR_BOTH_HORIZ
);
...
...
vinagre/vinagre-utils.c
View file @
04e7a59f
...
...
@@ -112,10 +112,7 @@ vinagre_utils_show_many_errors (const gchar *title, GSList *items, GtkWindow *pa
void
vinagre_utils_toggle_widget_visible
(
GtkWidget
*
widget
)
{
if
(
GTK_WIDGET_VISIBLE
(
widget
))
gtk_widget_hide
(
widget
);
else
gtk_widget_show_all
(
widget
);
gtk_widget_set_visible
(
widget
,
!
gtk_widget_get_visible
(
widget
));
}
const
gchar
*
...
...
@@ -328,9 +325,9 @@ vinagre_utils_get_window_workspace (GtkWindow *gtkwindow)
guint
ret
=
VINAGRE_ALL_WORKSPACES
;
g_return_val_if_fail
(
GTK_IS_WINDOW
(
gtkwindow
),
0
);
g_return_val_if_fail
(
GTK_WIDGET_REALIZED
(
GTK_WIDGET
(
gtkwindow
)),
0
);
g_return_val_if_fail
(
gtk_widget_get_realized
(
GTK_WIDGET
(
gtkwindow
)),
0
);
window
=
GTK_WIDGET
(
gtkwindow
)
->
window
;
window
=
gtk_widget_get_window
(
GTK_WIDGET
(
gtkwindow
)
)
;
display
=
gdk_drawable_get_display
(
window
);
gdk_error_trap_push
();
...
...
@@ -616,10 +613,10 @@ control_ok_button (GtkEditable *entry, ControlOKButton *data)
{
gboolean
enabled
=
TRUE
;
if
(
GTK_WIDGET_VISIBLE
(
data
->
uname
))
if
(
gtk_widget_get_visible
(
data
->
uname
))
enabled
=
enabled
&&
gtk_entry_get_text_length
(
GTK_ENTRY
(
data
->
uname
))
>
0
;
if
(
GTK_WIDGET_VISIBLE
(
data
->
pw
))
if
(
gtk_widget_get_visible
(
data
->
pw
))
enabled
=
enabled
&&
gtk_entry_get_text_length
(
GTK_ENTRY
(
data
->
pw
))
>
0
;
gtk_widget_set_sensitive
(
data
->
button
,
enabled
);
...
...
vinagre/vinagre-window.c
View file @
04e7a59f
...
...
@@ -103,15 +103,15 @@ vinagre_window_show_hide_controls (VinagreWindow *window)
{
if
(
window
->
priv
->
fullscreen
)
{
window
->
priv
->
fav_panel_visible
=
GTK_WIDGET_VISIBLE
(
window
->
priv
->
fav_panel
);
window
->
priv
->
fav_panel_visible
=
gtk_widget_get_visible
(
window
->
priv
->
fav_panel
);
gtk_widget_hide
(
window
->
priv
->
fav_panel
);
window
->
priv
->
toolbar_visible
=
GTK_WIDGET_VISIBLE
(
window
->
priv
->
toolbar
);
window
->
priv
->
toolbar_visible
=
gtk_widget_get_visible
(
window
->
priv
->
toolbar
);
gtk_widget_hide
(
window
->
priv
->
toolbar
);
gtk_widget_hide
(
window
->
priv
->
menubar
);
window
->
priv
->
statusbar_visible
=
GTK_WIDGET_VISIBLE
(
window
->
priv
->
statusbar
);
window
->
priv
->
statusbar_visible
=
gtk_widget_get_visible
(
window
->
priv
->
statusbar
);
gtk_widget_hide
(
window
->
priv
->
statusbar
);
gtk_notebook_set_show_tabs
(
GTK_NOTEBOOK
(
window
->
priv
->
notebook
),
FALSE
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment