X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=shell%2Fev-utils.c;h=5c5e165f979dec47d06c36d1a787b3d1c22af674;hb=d52ff81f97f4bd3794e1517443096846baee068b;hp=d77e91ff87936637a7b10c4748f42ddbe48fab02;hpb=db8a118298552769e835c67d29dfe1fa41de698a;p=evince.git diff --git a/shell/ev-utils.c b/shell/ev-utils.c index d77e91ff..5c5e165f 100644 --- a/shell/ev-utils.c +++ b/shell/ev-utils.c @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ @@ -247,16 +247,18 @@ ev_gui_menu_position_tree_selection (GtkMenu *menu, GtkTreeView *tree_view = GTK_TREE_VIEW (user_data); GtkWidget *widget = GTK_WIDGET (user_data); GtkRequisition req; + GtkAllocation allocation; GdkRectangle visible; gtk_widget_size_request (GTK_WIDGET (menu), &req); - gdk_window_get_origin (widget->window, x, y); + gdk_window_get_origin (gtk_widget_get_window (widget), x, y); + gtk_widget_get_allocation (widget, &allocation); - *x += (widget->allocation.width - req.width) / 2; + *x += (allocation.width - req.width) / 2; /* Add on height for the treeview title */ gtk_tree_view_get_visible_rect (tree_view, &visible); - *y += widget->allocation.height - visible.height; + *y += allocation.height - visible.height; selection = gtk_tree_view_get_selection (tree_view); selected_rows = gtk_tree_selection_get_selected_rows (selection, &model); @@ -303,24 +305,6 @@ get_num_monitors (GtkWindow *window) return gdk_screen_get_n_monitors (screen); } -gdouble -get_screen_dpi (GtkWindow *window) -{ - GdkScreen *screen; - gdouble dp, di; - - screen = gtk_window_get_screen (window); - - /*diagonal in pixels*/ - dp = hypot (gdk_screen_get_width (screen), gdk_screen_get_height (screen)); - - /*diagonal in inches*/ - di = hypot (gdk_screen_get_width_mm(screen), gdk_screen_get_height_mm (screen)) / 25.4; - - return (dp / di); -} - - void file_chooser_dialog_add_writable_pixbuf_formats (GtkFileChooser *chooser) {