Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
2a2071c3
Commit
2a2071c3
authored
Mar 17, 2003
by
Jan Djärv
Browse files
* gtkutil.c (xg_set_toolkit_scroll_bar_thumb): Check if new values
equal old values before updating.
parent
17097258
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
9 deletions
+25
-9
src/ChangeLog
src/ChangeLog
+3
-0
src/gtkutil.c
src/gtkutil.c
+22
-9
No files found.
src/ChangeLog
View file @
2a2071c3
2003-03-18 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* gtkutil.c (xg_set_toolkit_scroll_bar_thumb): Check if new values
equal old values before updating.
* xterm.c (xg_scroll_callback): Remove xg_ignore_next_thumb.
* gtkutil.c (xg_initialize): Remove xg_ignore_next_thumb.
...
...
src/gtkutil.c
View file @
2a2071c3
...
...
@@ -2625,6 +2625,7 @@ xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
gdouble
shown
;
gdouble
top
;
int
size
,
value
;
int
new_upper
,
new_step
;
adj
=
gtk_range_get_adjustment
(
GTK_RANGE
(
wscroll
));
...
...
@@ -2652,21 +2653,33 @@ xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
value
=
min
(
value
,
whole
-
size
);
value
=
max
(
value
,
XG_SB_MIN
);
adj
->
page_size
=
(
int
)
size
;
/* gtk_range_set_value invokes the callback. Set
ignore_gtk_scrollbar to make the callback do nothing */
xg_ignore_gtk_scrollbar
=
1
;
gtk_range_set_range
(
GTK_RANGE
(
wscroll
),
adj
->
lower
,
max
(
whole
,
size
));
new_upper
=
max
(
whole
,
size
);
new_step
=
portion
/
max
(
1
,
FRAME_HEIGHT
(
f
));
if
((
int
)
adj
->
page_size
!=
size
||
(
int
)
adj
->
upper
!=
new_upper
||
(
int
)
adj
->
step_increment
!=
new_step
)
{
adj
->
page_size
=
(
int
)
size
;
gtk_range_set_range
(
GTK_RANGE
(
wscroll
),
adj
->
lower
,
(
gdouble
)
new_upper
);
/* Assume all lines are of equal size. */
/* Assume a page increment is about 95% of the page size */
gtk_range_set_increments
(
GTK_RANGE
(
wscroll
),
portion
/
max
(
1
,
FRAME_HEIGHT
(
f
)),
(
int
)
(
0
.
95
*
adj
->
page_size
));
}
/* Assume all lines are of equal size. */
/* Assume a page increment is about 95% of the page size */
gtk_range_set_increments
(
GTK_RANGE
(
wscroll
),
portion
/
max
(
1
,
FRAME_HEIGHT
(
f
)),
(
int
)
(
0
.
95
*
adj
->
page_size
));
if
((
int
)
gtk_range_get_value
(
GTK_RANGE
(
wscroll
))
!=
value
)
gtk_range_set_value
(
GTK_RANGE
(
wscroll
),
(
gdouble
)
value
);
gtk_range_set_value
(
GTK_RANGE
(
wscroll
),
(
gdouble
)
value
);
xg_ignore_gtk_scrollbar
=
0
;
/* Make GTK draw the new thumb. We are not using a pure GTK event
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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